-- MongoDB
[MongoDB] $where 쿼리
어린왕자악꿍
2013. 1. 2. 14:30
조건으로자바스크립트구문이나함수를사용하여조회하기위해사용한다.
속도가느리므로꼭필요한곳에서만사용해야한다.
> db.person.find( { $where : "this.age == this.cardno" } )
> db.person.find( { $where : "obj.age == obj.cardno" } )
> db.person.find( { $where : function() { return (this.age == this.cardno) } } )
> db.person.find( { $where : function() { return obj.age == obj.cardno; } } )