a doc {"m":[1,2,3], "others":xxx}, get the first element in array 'm' by:
db.find({query},{"m":{$slice:1}, "m":1})
the return is {"m":[1]}, the element in doc is an array. But in this query, only one element in array will be get, so I don't need the return doc contain array which has only one element. This is like SQL local variable in sub-query. The element I want has no name in original doc, if I want get it then I need to make a name for it, the doc returned I wanted is like: {"localVariable":1} rather than {"m":[1]}
I try to project out the first element by:
db.find({query},{"m":{$slice:1}, "m.1":1})
but this don't work.