Closed ghost closed 10 years ago
I think option 2 is the best option... supporting single quotes. If MongoDB supports single quotes, it only makes sense to develop the driver consistent with MongoDB practices. Looking into this.
This bug is fixed, and the latest version of BSONSerializer is comitted.
I need to send you a xojo file: how could I do that?
You can commit your file directly into git if you want, or if it's easier... you can send the file as an email attachment to mail@chessconquest.com.
I've also created a shared DropBox folder (sent you an invite via email), to make file sharing easy.
The current driver is getting troubles with single quote.
Here some examples:
The client provides double quotes to the key and the value: the inserted document is found unmodified - so far so good.
This one is fine too - in pure JSON the key should be quoted but this is not a requirement for MongoDB : it works fine too.
Here come the troubles: there is an issue with single quotes - which are common practice for MongoDB: 1 - the single quote was inserted around the key string 2 - the value was set to 0
Here you'll have 2 options:
1 - single quote are not supported by this driver: in that case you should remove them before inserting
2 - single quote are suppored by this driver: in that case you should replace them to double quote before inserting
Side issue but probably the same: from my testing you don't escape single quote and the like before inserting a document in collection:
will raise an OutOfBound exception in encodeObject() method.