We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When comparing two mongoose models whose _id or discriminated docs arent equal, the library returns no differences.
Steps to reproduce: (pseudo code)
1.Find a document
const original = await exampe.findOne(...); // original.referencedDoc has value = new ObjectId("667c39c3ef67892912314323");
await original.update({ referencedDoc: new ObjectId("64c7cda1db76ef25cfc5f901"); }) const latestDocument = await exampe.findOne(...);
const diffs = diff(original, latestDocument); console.log('diff', diffs)
Output: (prints no differences) {}
{}
Expected output: (should print the difference)
{ referencedDoc: new ObjectId("64c7cda1db76ef25cfc5f901"); }
This bug may be fixed by changing the isEmpty utility function:
isEmpty
const isEmpty = o => Object.keys(o).length === 0;
It is returning zero because "ObjectId" is a class without "keys", but it can be readed as a string perfectly.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When comparing two mongoose models whose _id or discriminated docs arent equal, the library returns no differences.
Steps to reproduce: (pseudo code)
1.Find a document
Output: (prints no differences)
{}
Expected output: (should print the difference)
This bug may be fixed by changing the
isEmpty
utility function:const isEmpty = o => Object.keys(o).length === 0;
It is returning zero because "ObjectId" is a class without "keys", but it can be readed as a string perfectly.
The text was updated successfully, but these errors were encountered: