Skip to content

This is not working when inserting your example in MongoDB Extended JSON docs. #3535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion source/reference/mongodb-extended-json.txt
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ NumberDecimal

db.json.insert( { decimalQuoted : NumberDecimal("123.40") } )
db.json.insert( { decimalUnQuoted : NumberDecimal(123.40) } )

This is throwing an error here with mongo 4.0.0 since NumberDecimal is unquoted.

When you retrieve the documents, the value of ``decimalUnQuoted`` has
changed, while ``decimalQuoted`` retains its specified precision:
Expand All @@ -481,4 +483,4 @@ NumberDecimal

db.json.find()
{ "_id" : ObjectId("596f88b7b613bb04f80a1ea9"), "decimalQuoted" : NumberDecimal("123.40") }
{ "_id" : ObjectId("596f88c9b613bb04f80a1eaa"), "decimalUnQuoted" : NumberDecimal("123.400000000000") }
{ "_id" : ObjectId("596f88c9b613bb04f80a1eaa"), "decimalUnQuoted" : NumberDecimal("123.400000000000") }