Sign In Register

How can we help you today?

Start a new topic
Answered

Help with NoSQL Explorer

Trying to play around with the NoSQL explorer, but there seems to be no documentation for it anywhere and I can't seem to put anything in any of the fields that doesn't result in an error... Is there anywhere that gives any kind of guidance for this?


As an example case, how would I query all users and just get their userName? I can get all users by entering nothing at all, but if I put username, "userName", {userName}, {"userName"} or pretty much any other conceivable entry in the "Fields" space, I get an error


Best Answer

In the 'fields' textbox of the NoSQL explorer, try this


{_id: -0, userName: 1}

 That essentially means to NOT include the usually always included _id field and to only show the userName field in the results.

You can find more examples and such here: https://docs.mongodb.com/manual/reference/method/db.collection.find/


Answer

In the 'fields' textbox of the NoSQL explorer, try this


{_id: -0, userName: 1}

 That essentially means to NOT include the usually always included _id field and to only show the userName field in the results.

You can find more examples and such here: https://docs.mongodb.com/manual/reference/method/db.collection.find/

Putting { "userName": 1 } in the Fields space should work.


In general, what you enter in the NoSQL tabs translate to MongoDB commands. The documents here are quite nice once you get used to them: https://docs.mongodb.com/manual/reference/method/db.collection.find/


( I think the version of MongoDB used currently 3.0, though basic operations are mostly the same in all versions. )

Thanks for the examples and the docs link! I'll be sure to check them out :)

Login to post a comment