2020-05-25

MongoDB - Filter string fields by character length

db.collection_name.find({ 
  "$expr": {"$lte": [{"$strLenCP": "$string_field_name"}, 5]} 
});

No comments:

Post a Comment