MCPcopy Create free account
hub / github.com/Automattic/mongoose / createMod

Function createMod

test/helpers/populate.splitPopulateQuery.test.js:18–30  ·  view source on GitHub ↗
(mod)

Source from the content-addressed store, hash-verified

16 });
17
18 function createMod(mod) {
19 return {
20 model: { schema: { path: () => null } },
21 options: {},
22 match: null,
23 docs: mod.ids.map((_, i) => ({ i })),
24 allIds: [...mod.ids],
25 unpopulatedValues: [...mod.ids],
26 foreignField: new Set(['_id']),
27 isRefPath: false,
28 ...mod
29 };
30 }
31
32 it('returns null if the entry only has one document', function() {
33 const mod = createMod({ ids: [[1, 2, 3, 4]] });

Calls

no outgoing calls

Tested by

no test coverage detected