Closed Wesseldr closed 2 years ago
I'm trying to run the following command:
db.createCollection("weather", { timeseries: { timeField: "timestamp" } } )
I tried several variations with the mongo$run command but that seems to always return unknown command. I had hope that this issue with creating an unique index could be transformed: https://github.com/jeroen/mongolite/issues/133#issuecomment-623007310
m <- mongolite::mongo(mongo_url, collection = 'col', db = 'test') mongo_connection$run('{"createIndexes": "col", "indexes":[{"key":{"field_A":1, "field_B": 1}, "name": "field_A_B_index", "unique": true]}')
Hope someone has done this before and knows a way :-)
Got it :-)
m$run('{ "create": "weather", "timeseries": { "timeField": "timestamp" }}') I'll leave the question here for others to find when looking for ways to create a timeseries collection
m$run('{ "create": "weather", "timeseries": { "timeField": "timestamp" }}')
I'm trying to run the following command:
db.createCollection("weather", { timeseries: { timeField: "timestamp" } } )
I tried several variations with the mongo$run command but that seems to always return unknown command. I had hope that this issue with creating an unique index could be transformed: https://github.com/jeroen/mongolite/issues/133#issuecomment-623007310
m <- mongolite::mongo(mongo_url, collection = 'col', db = 'test') mongo_connection$run('{"createIndexes": "col", "indexes":[{"key":{"field_A":1, "field_B": 1}, "name": "field_A_B_index", "unique": true]}')
Hope someone has done this before and knows a way :-)