此查询将给出字段值和长度:
db.usercollection.aggregate([ { $project: { "name": 1, "length": { $strLenCP: "$name" } }} ])