The records in my database are
{\"_id\":\"1\",\"fn\":\"sagar\",\"ln\":\"Varpe\"}
{\"_id\":\"1\",\"fn\":\"sag\",\"score\":\"10\"}
{\"_id\":\"1\",\"ln\":\"ln
db.collection.find({ ln: { $exists: true} });
The $size operator matches any array with the number of elements specified by the argument. For example:
db.collection.find({ ln: { $exists: true, $size: 0 } });
$size does not accept ranges of values. To select documents based on fields with different numbers of elements, create a counter field that you increment when you add elements to a field.