TokuMx: problems with "upsert" command

7 views
Skip to first unread message

dcher...@iponweb.net

unread,
Nov 22, 2016, 7:02:53 AM11/22/16
to Percona Discussion, Дмитрий Черненко
Hello!

We're using a TokuMx instead of clear MongoDB.
Today we got some problems with using custom "_id" indexes.

Below is an example with "upsert" command in case of new documents:

> db.user.find({})
> db.user.update({_id: {$in:[1,2]}}, {$set:{field1: "value1"}}, {upsert: true, multiple: true})
> db.user.find({})
{ "_id" : ObjectId("5834327e91ad1025d5aaf25c"), "field1" : "value1" }

As you can see TokuMx didn't create documents with _id=1 and _id=2. Instead of this it created only one document with standart Mongo Id - ObjectId.

In case of "upsert" without "$in" option:

> db.user.find({})
> db.user.update({_id: 1}, {$set:{field1: "value1"}}, {upsert: true, multiple: true})
> db.user.find({})
{ "_id" : 1, "field1" : "value1" }

It works fine.

Can you please explain for me my mistake? What is incorrect in first "upsert" command?

The list of installed TokuMX packages:
$ dpkg -l | grep tokumx | grep ^ii
ii tokumx 2.0.1 amd64 object/document-oriented database (metapackage)
ii tokumx-clients 2.0.1 amd64 object/document-oriented database (client apps)
ii tokumx-common 2.0.1 amd64 object/document-oriented database (common package)
ii tokumx-server 2.0.1 amd64 object/document-oriented database (server package)

Thanks in advance.

With best regards, Chernenko Dmitiry.

Reply all
Reply to author
Forward
0 new messages