top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to get all query which related 1 collection in mongodb?

0 votes
353 views

How to get all query which related 1 collection in mongodb? for oracle,we can get all query from system view like v$sql, but I am not sure if mongodb have this system view to see all query related 1 special collection?

posted Jul 7, 2015 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

I am trying to get all the collection names from MongoDb server using C# code using db.GetCollectionNames() method.

I have 12 collections in my database, but the above method returns an empty list. I have verified that I am referring to the correct database. What am I doing wrong? Or if there is an alternate way?

+3 votes

Here I would like to explain my query a bit more.

I inserted multiple documents within a collection. Few documents have same set of keys and few of them have some extra key:value pairs . For example:
document 1 : key1 : "key1"
document 2: key1 : "key1", key2: "key2"
document 3: key1 : "key1", key2: "key2", key3 : "key3"
document 4: key1 : "key1", key3 : "key3"

Now I want to delete the documents which have key1 and key2.
What will be the command to do so ?

...