i have collection called "devices". this devices collection have two fields called as "devices" and "totalDeviceNeeds". totalDeviceNeeds have integer value. devices field contain array. I want to get all documents that totalDeviceNeeds > devices array size. How can i do that. I try lot of ways and didnt get correct. I try in nodejs.
db.devices.find( { $where: "this.totalDeviceNeeds > this.devices.length" } );