Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FDMongoQuery QMatch impossible to find using ObjectId C++Builder Berlin


This question is answered.


Permlink Replies: 2 - Last Post: Aug 16, 2016 11:10 PM Last Post By: Gaetano Mantovani
Gaetano Mantovani

Posts: 19
Registered: 8/30/14
FDMongoQuery QMatch impossible to find using ObjectId C++Builder Berlin  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 12, 2016 6:50 AM
Hello,
I'm trying to filter a FDMongoQuery, inserting in the QMatch property the word ObjectId and I faced the error 'unexpected character encoountered while parsing value: O. Path ..."

this is the query in MongoDb

db.nationalities.find({"_id": ObjectId("57ab21437a7c333d8c000441")})

this is the QMatch value String in the FDMongoQuery
{"_id": ObjectId("57ab21437a7c333d8c000441")}

can you help me ? Thanks
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FDMongoQuery QMatch impossible to find using ObjectId C++Builder Berlin
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 16, 2016 9:07 AM   in response to: Gaetano Mantovani in response to: Gaetano Mantovani
You should use Strict Mode JSON:
https://docs.mongodb.com/manual/reference/mongodb-extended-json/

The right expression will be:
{"_id": {"$oid": "57ab21437a7c333d8c000441"}}

--
With best regards,
Dmitry
Gaetano Mantovani

Posts: 19
Registered: 8/30/14
Re: FDMongoQuery QMatch impossible to find using ObjectId C++Builder Berlin  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 16, 2016 11:10 PM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Thank you Dmitry !!

Dmitry Arefiev wrote:
You should use Strict Mode JSON:
https://docs.mongodb.com/manual/reference/mongodb-extended-json/

The right expression will be:
{"_id": {"$oid": "57ab21437a7c333d8c000441"}}

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02