You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Factoria to generate fixtured for some integration tests.
I'm using MongoDb and sometimes I need knowledge of what an Object's '_id' will be before it's created.
Passing overrides to a Model like in the examples below returns an Object that cannot be written directly to MongoDb because Deepmerge.all clones 'every property from all types of objects'.
const user_id = new ObjectId();
const user = Factory("User", 1, { _id: user_id });
`
Can we modify the deepmerge.all on line 52 of index.ts to accept options that implements isMergeableObject and only clones properties from non-instantiated objects?
{ isMergeableObject: isPlainObject }
The text was updated successfully, but these errors were encountered:
I'm using Factoria to generate fixtured for some integration tests.
I'm using MongoDb and sometimes I need knowledge of what an Object's '_id' will be before it's created.
Passing overrides to a Model like in the examples below returns an Object that cannot be written directly to MongoDb because Deepmerge.all clones 'every property from all types of objects'.
`
Factory.define("User", (faker) => ({
_id: new ObjectId(),
firstname: faker.name.firstName(),
lastname: faker.name.lastName(),
email: faker.internet.email(),
timezone: faker.address.timeZone(),
}))
const user_id = new ObjectId();
const user = Factory("User", 1, { _id: user_id });
`
Can we modify the deepmerge.all on line 52 of index.ts to accept options that implements isMergeableObject and only clones properties from non-instantiated objects?
{ isMergeableObject: isPlainObject }
The text was updated successfully, but these errors were encountered: