mongodb - Why is Robomongo returning an object from db.collection.distinct() instead of an array? -
using example mongodb reference, i'd expect db.inventory.distinct("dept");
return array ["a", "b"]
, , that's happens when run shell. using robomongo (on os x) instead object name-value pairs, so: { "0" :"a", "1": "b" }
.
this setup:
db.inventory.drop(); db.inventory.insert([ { "_id": 1, "dept": "a", "item": { "sku": "111", "color": "red" }, { "_id": 2, "dept": "a", "item": { "sku": "111", "color": "blue" }, { "_id": 3, "dept": "b", "item": { "sku": "222", "color": "blue" }, { "_id": 4, "dept": "a", "item": { "sku": "333", "color": "black" } ]);
why robomongo behaving different? can it?
Comments
Post a Comment