field
- name string
- x int
- y int
Table record
name | x | y |
jhon | 1 | 2 |
lily | 2 | 1 |
gan | 3 | 2 |
Query result
Query all name for all x > y
db.collections.find({'$where': "this.x > this.y"}, {'name': 1})
name | x | y |
jhon | 1 | 2 |
lily | 2 | 1 |
gan | 3 | 2 |
Query all name for all x > y
db.collections.find({'$where': "this.x > this.y"}, {'name': 1})