LoginSignup
0
0

More than 5 years have passed since last update.

MongoError (upsert): not okForStorage がでたときの原因と対処法

Last updated at Posted at 2015-03-24

mongo2.4.12 で起きたMongoError(2.6系未確認)

MongoError: MongoError (upsert): not okForStorage
query: {"_id":"0023bec94302e15e90e774cd270487a5"}
update: {"\$set":{"data":{"2015032317":{"9aci\$113534":1427100832164  //⬅ key名に"$"がはいってしまっている}}}}

updateするデータのkey名に "$"が入っているのが原因でした。
ちなみに下の参考urlによると、 "."がkeyにある場合も同様のエラーが出るらしいです。

not okForStorageエラーが出た場合は、updateするデータのkeyに "$"または"."が入ってしまっているか確認する

(参考)
https://jira.mongodb.org/browse/SERVER-5674
http://stackoverflow.com/questions/6041109/mongo-update-query-given-error

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0