我试过这些查询,但返回错误。 一。
db.usercollection.find( {$where: "(this.name.length > 40)"} ).limit(2); output :error: { "$err" : "TypeError: Cannot read property 'length' of undefined near '40)' ", "code" : 16722 }
这在2.4.9中有效,但我的版本是2.6.5