Given the following MongoDB documents...
{ "_id" : ObjectId("55e67b28010000880ca4c043"), "amount" : { "value" : 1.125, "currency" : "USD" } }
{ "_id" : ObjectId("55e897e60100009f0051da48"), "amount" : { "value" : 1.525, "currency" : "USD" } }
{ "_id" : ObjectId("55ea1b520100006d004e602a"), "amount" : { "value" : 1.825, "currency" : "USD" } }
How do I get the document with amount.value
closest to 2.0 (1.825 in this case)? For instance, I need to create a query that takes a number as the input and returns the document with amount.value
closest to the specified number.