-
1. Re: Mongodb - criteria on ObjectId
rareddy Dec 1, 2016 12:06 PM (in response to mtawk)_id construct of the MongoDB. You need to use the column on your table. Typically _id maps your Table's PK.
-
2. Re: Mongodb - criteria on ObjectId
mtawk Dec 2, 2016 4:00 AM (in response to rareddy)Since _id maps the table PK, and teiid recognize it in select statement, why I can not create a criteria over its value.
It is about the interpretation of the mongodb command: test.Customer2.find({_id:"a59e3722dcfd3f5879563cf8"})
Also such a criteria may be needed if we want to update the values of a certain collection document
-
3. Re: Mongodb - criteria on ObjectId
rareddy Dec 2, 2016 10:06 AM (in response to mtawk)Mark,
What I am saying is if you defined the PK on your table and supplied a value for that PK then use that for criteria, as the value of the PK *you* defined will be replaced as _id in MongoDB collection. If you used "native" importer to import the existing collections, or you named your PK column name as "_id" then "_id" is mapped as PK of your table.
Looks like you already have this mapping. What is data type showing on your PK column?
One thing I have not implemented/tested "AUTO_INCREMENT" feature with primary key, where if you do not define the "_id" value it is automatically generated. MongoDB already does this, but Teiid needs to allow it go through when "_id" value not there in the INSERT statement. You can log a feature request for that.
Ramesh..
-
-