MongoVUE 0.5.0 introduces support for ObjectIds in querying and updating collections.

In MongoDB shell, to search a collection named “cities” using ObjectId, you would use the following command:

	"_id": ObjectId("4c52d024bac706153000914d")

To execute the same Find command in MongoVUE, you need to make a small change by adding the JavaScript “new” keyword before ObjectId:

Use "new" keyword with ObjectIds

Tags: , ,

3 Responses to “Using ObjectIds”

  1. Rob July 26, 2011 at 11:42 am #

    How can I use the binary data type? This doesn’t seem the work:

    “_id” : new BinData(3, “PZTWQSoZu0CQ/q13vb3jdA==”)

    • Venetia August 26, 2011 at 12:46 am #

      I need to query by BinData too – This is a serious lack!

    • Per October 3, 2011 at 5:49 pm #

      Don’t know if this helps, but If you write:
      “CampaignId”: new Guid(“5d3e1249-fe4f-49cb-8cd1-952a9e14dcc6″)

      it translates to (in the Learn Shell)
      db.Customers.find({ “CampaignId” : new BinData(3, “SRI+XU/+y0mM0ZUqnhTcxg==”) })