Find MongoDB records where array field is not empty
If you also have documents that don’t have the key, you can use: ME.find({ pictures: { $exists: true, $not: {$size: 0} } }) MongoDB doesn’t use indexes if $size is involved, so here is a better solution: ME.find({ pictures: { $exists: true, $ne: [] } }) If your property can have invalid values (like null … Read more