Description Usage Arguments Details Value See Also Examples
View source: R/mongo_high_level.R
Get a vector of distinct values for keys in a collection.
1 | mongo.distinct(mongo, ns, key, query = mongo.bson.empty())
|
mongo |
(mongo) A mongo connection object. |
ns |
(string) The namespace of the collection in which to find distinct keys. |
key |
(string) The name of the key field for which to get distinct values. |
query |
mongo.bson An optional query to restrict the returned values. |
See http://www.mongodb.org/display/DOCS/Aggregation#Aggregation-Distinct.
vector of distinct values or NULL if the command failed.
(vector) The result set of distinct keys.
mongo.command
,
mongo.simple.command
,
mongo.find
,
mongo.
1 2 3 4 5 | mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
keys <- mongo.distinct(mongo, "test.people", "name")
print(keys)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.