[SERVER-71979] Allow comparing JS objects over 16MB with BSON comparison functions Created: 08/Dec/22  Updated: 29/Aug/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Romans Kasperovics Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query Execution
Participants:

 Description   

Currently we expose useful BSON comparison functions in mongo shell that can be used on JavaScript objects:

  • bsonWoCompare()
  • bsonUnorderedFieldsCompare()
  • bsonBinaryEqual()

All functions perform JS -> BSON translation, which fails if object size exceeds 16MB.

I would argue this limitation can be lifted here, because the functions do not store objects in the database.



 Comments   
Comment by Romans Kasperovics [ 11/Jan/23 ]

steve.tarzia@mongodb.com : Only if we want to compare large JSON objects in tests. There was only one test doing it so far and I had to change it to work with my new implementation of assert.docEq().

In other words, I had to replace assert.docEq(coll1.find().toArray(), coll2.find().toArray()) with assert.eq(coll1.count(), coll2.count()) and assert.eq(coll1.hashAllDocs(), coll2.hashAllDocs()).

Generated at Thu Feb 08 06:20:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.