db.createCollection('orAndSort');
db.orAndSort.insert({name: "red", value: 1})
db.orAndSort.insert({name: "red", value: 2})
db.orAndSort.insert({name: "red", value: 3})
db.orAndSort.insert({name: "blue", value: 10})
db.orAndSort.insert({name: "blue", value: 20})
db.orAndSort.insert({name: "green", value: 100})
db.orAndSort.aggregate([
{ '$match': { '$or': [ { name: 'red' }, { name: 'blue' }] } },
{ '$sort': { value: 1 }}
]);
assert: command failed: {
"errmsg" : "exception: cursor encountered an error",
"code" : 17285,
"ok" : 0
} : aggregate failed
Error: command failed: {
"errmsg" : "exception: cursor encountered an error",
"code" : 17285,
"ok" : 0
} : aggregate failed
at Error (<anonymous>)
at doassert (src/mongo/shell/assert.js:11:14)
at Function.assert.commandWorked (src/mongo/shell/assert.js:244:5)
at DBCollection.aggregate (src/mongo/shell/collection.js:1149:12)
at (shell):1:14
2014-04-23T17:40:02.818-0400 Error: command failed: {
"errmsg" : "exception: cursor encountered an error",
"code" : 17285,
"ok" : 0
} : aggregate failed at src/mongo/shell/assert.js:13
db.orAndSort.aggregate([
{ '$match': { '$or': [ { name: 'red' }, { name: 'blue' }] } },
{ '$project': {name: 1, value: 1}},
{ '$sort': { value: 1 }}
]);
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/bafa70e9-3b60-45e1-8ca0-5afb3e750660%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.