mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-16 15:41:41 +00:00
Use new ObjectId instead of ObjectId()
GitOrigin-RevId: bfbf9f1d6b84a13f32fce127f01a49b1deaee6fe
This commit is contained in:
parent
e08c60424d
commit
5cd5c1bffc
1 changed files with 12 additions and 4 deletions
|
@ -130,11 +130,15 @@ describe('MongoTests', function () {
|
|||
expectInQueryWithNativeObjectIds(query)
|
||||
})
|
||||
it('should transform all Mongoose ObjectIds to native ObjectIds', function () {
|
||||
const query = normalizeMultiQuery(userIds.map(MongooseObjectId))
|
||||
const query = normalizeMultiQuery(
|
||||
userIds.map(userId => new NativeObjectId(userId))
|
||||
)
|
||||
expectInQueryWithNativeObjectIds(query)
|
||||
})
|
||||
it('should leave all native Objects as native ObjectIds', function () {
|
||||
const query = normalizeMultiQuery(userIds.map(NativeObjectId))
|
||||
const query = normalizeMultiQuery(
|
||||
userIds.map(userId => new NativeObjectId(userId))
|
||||
)
|
||||
expectInQueryWithNativeObjectIds(query)
|
||||
})
|
||||
|
||||
|
@ -143,11 +147,15 @@ describe('MongoTests', function () {
|
|||
await expectToFindTheThreeUsers(query)
|
||||
})
|
||||
it('should find the three users from Mongoose ObjectIds', async function () {
|
||||
const query = normalizeMultiQuery(userIds.map(MongooseObjectId))
|
||||
const query = normalizeMultiQuery(
|
||||
userIds.map(userId => new NativeObjectId(userId))
|
||||
)
|
||||
await expectToFindTheThreeUsers(query)
|
||||
})
|
||||
it('should find the three users from native ObjectIds', async function () {
|
||||
const query = normalizeMultiQuery(userIds.map(NativeObjectId))
|
||||
const query = normalizeMultiQuery(
|
||||
userIds.map(userId => new NativeObjectId(userId))
|
||||
)
|
||||
await expectToFindTheThreeUsers(query)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue