MongoDB: how to compare $size of array to another document item?
问题 MongoDB: how to do something like this, both in mongo console and via JavaScript, Node.js: db.turnys.find( { users:{$size:seats } } ) turnydb.turnys looks like this: [ { "gId": "5335e4a7b8cf51bcd054b423", "seats": 2, "start": "2014-03-30T14:23:29.688Z", "end": "2014-03-30T14:25:29.688Z", "rMin": 800, "rMax": 900, "users": [], "_id": "533828e1d1a483b7fd8a707a" }, { "gId": "5335e4a7b8cf51bcd054b423", "seats": 2, "start": "2014-03-30T14:23:29.688Z", "end": "2014-03-30T14:25:29.688Z", "rMin": 900