I want to add an new document in an mongodb existant collection. But this collection is a shard collection. My shard key is _id.
{"CODE_LOG":260,"Date": {"$date" : "2015-10-27T18:21:37.55Z" }}
I get this error :
{"http status code":400,"http status description":"Bad Request","message":"Write request for sharded collection must specify the shardkey. Use the 'shardkey' query parameter."}
I don't want to specify the value of the shardkey.
The error (code 61) is from MongoDB. RESTHeart just manages it and returns the error message that you reported with response status code 400 BAD REQUEST.
See error codes here
However the restheart documentation page about shardkey reports
You should check your configuration and make sure that the shard key is actually only the _id.