Created
March 15, 2010 15:58
-
-
Save masatomo/332977 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doc1: {"num": [3, 10, 25], "type": "A"} | |
doc2: {"num": [1, 2, 3, 5], "type": "B"} | |
doc3: {"num": [5, 6, 7, 1], "type": "A"} | |
At the moment, i can do that something like: | |
db.something.find({"type": "A"}, {"num": 1}) | |
I get something like: | |
"num": [5, 6, 7, 1] | |
"num": [3, 10, 25] | |
But I want to get [1, 3, 5, 6, 7, 10, 25]. (Even better if i get only top N like [1, 3, 5] when N=3) | |
And I don't care about type of return. And, it's much better i can get new documents with cursor like: | |
new document 1: {1} | |
new document 2: {3} | |
new document 3: {5} | |
......... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment