OP_MSG create time series collection

Is it possible to create collection explicitly through op_msg?
like for example sending
{ "create": "collection-name", "timeseries": {"timeField": "timestamp", "metaField": "metadata"} }
?
for this query im getting
{ “ok” : 0.0, “errmsg” : “OP_MSG requests require a $db argument”, “code” : 40571, “codeName” : “Location40571” } as return
(I’m using tcp/ip and simply sending via a socket)

nvm i just forgot $db at end
{ "create": "collection-name", "timeseries": {"timeField": "timestamp", "metaField": "metadata"} "$db": "new-ts-test"}
{ “ok” : 1.0 }

Thanks a lot!

1 Like