@payloadcms/db-mongodb 3.57.0-canary.7 → 3.57.0-internal.1d2ebbc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/find.js +1 -1
- package/dist/find.js.map +1 -1
- package/dist/findDistinct.d.ts.map +1 -1
- package/dist/findDistinct.js +3 -12
- package/dist/findDistinct.js.map +1 -1
- package/package.json +3 -3
package/dist/find.js
CHANGED
|
@@ -29,7 +29,7 @@ export const find = async function find({ collection: collectionSlug, draftsEnab
|
|
|
29
29
|
locale,
|
|
30
30
|
sort: sortArg || collectionConfig.defaultSort,
|
|
31
31
|
sortAggregation,
|
|
32
|
-
timestamps:
|
|
32
|
+
timestamps: true
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
const query = await buildQuery({
|
package/dist/find.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/find.ts"],"sourcesContent":["import type { PaginateOptions, PipelineStage } from 'mongoose'\nimport type { Find } from 'payload'\n\nimport { flattenWhereToOperators } from 'payload'\n\nimport type { MongooseAdapter } from './index.js'\n\nimport { buildQuery } from './queries/buildQuery.js'\nimport { buildSortParam } from './queries/buildSortParam.js'\nimport { aggregatePaginate } from './utilities/aggregatePaginate.js'\nimport { buildJoinAggregation } from './utilities/buildJoinAggregation.js'\nimport { buildProjectionFromSelect } from './utilities/buildProjectionFromSelect.js'\nimport { getCollection } from './utilities/getEntity.js'\nimport { getSession } from './utilities/getSession.js'\nimport { resolveJoins } from './utilities/resolveJoins.js'\nimport { transform } from './utilities/transform.js'\n\nexport const find: Find = async function find(\n this: MongooseAdapter,\n {\n collection: collectionSlug,\n draftsEnabled,\n joins = {},\n limit = 0,\n locale,\n page,\n pagination,\n projection,\n req,\n select,\n sort: sortArg,\n where = {},\n },\n) {\n const { collectionConfig, Model } = getCollection({ adapter: this, collectionSlug })\n\n const session = await getSession(this, req)\n\n let hasNearConstraint = false\n\n if (where) {\n const constraints = flattenWhereToOperators(where)\n hasNearConstraint = constraints.some((prop) => Object.keys(prop).some((key) => key === 'near'))\n }\n\n const sortAggregation: PipelineStage[] = []\n\n let sort\n if (!hasNearConstraint) {\n sort = buildSortParam({\n adapter: this,\n config: this.payload.config,\n fields: collectionConfig.flattenedFields,\n locale,\n sort: sortArg || collectionConfig.defaultSort,\n sortAggregation,\n timestamps:
|
|
1
|
+
{"version":3,"sources":["../src/find.ts"],"sourcesContent":["import type { PaginateOptions, PipelineStage } from 'mongoose'\nimport type { Find } from 'payload'\n\nimport { flattenWhereToOperators } from 'payload'\n\nimport type { MongooseAdapter } from './index.js'\n\nimport { buildQuery } from './queries/buildQuery.js'\nimport { buildSortParam } from './queries/buildSortParam.js'\nimport { aggregatePaginate } from './utilities/aggregatePaginate.js'\nimport { buildJoinAggregation } from './utilities/buildJoinAggregation.js'\nimport { buildProjectionFromSelect } from './utilities/buildProjectionFromSelect.js'\nimport { getCollection } from './utilities/getEntity.js'\nimport { getSession } from './utilities/getSession.js'\nimport { resolveJoins } from './utilities/resolveJoins.js'\nimport { transform } from './utilities/transform.js'\n\nexport const find: Find = async function find(\n this: MongooseAdapter,\n {\n collection: collectionSlug,\n draftsEnabled,\n joins = {},\n limit = 0,\n locale,\n page,\n pagination,\n projection,\n req,\n select,\n sort: sortArg,\n where = {},\n },\n) {\n const { collectionConfig, Model } = getCollection({ adapter: this, collectionSlug })\n\n const session = await getSession(this, req)\n\n let hasNearConstraint = false\n\n if (where) {\n const constraints = flattenWhereToOperators(where)\n hasNearConstraint = constraints.some((prop) => Object.keys(prop).some((key) => key === 'near'))\n }\n\n const sortAggregation: PipelineStage[] = []\n\n let sort\n if (!hasNearConstraint) {\n sort = buildSortParam({\n adapter: this,\n config: this.payload.config,\n fields: collectionConfig.flattenedFields,\n locale,\n sort: sortArg || collectionConfig.defaultSort,\n sortAggregation,\n timestamps: true,\n })\n }\n\n const query = await buildQuery({\n adapter: this,\n collectionSlug,\n fields: collectionConfig.flattenedFields,\n locale,\n where,\n })\n\n // useEstimatedCount is faster, but not accurate, as it ignores any filters. It is thus set to true if there are no filters.\n const useEstimatedCount = hasNearConstraint || !query || Object.keys(query).length === 0\n const paginationOptions: PaginateOptions = {\n lean: true,\n leanWithId: true,\n options: {\n session,\n },\n page,\n pagination,\n projection,\n sort,\n useEstimatedCount,\n }\n\n if (select) {\n paginationOptions.projection = buildProjectionFromSelect({\n adapter: this,\n fields: collectionConfig.flattenedFields,\n select,\n })\n }\n\n if (this.collation) {\n const defaultLocale = 'en'\n paginationOptions.collation = {\n locale: locale && locale !== 'all' && locale !== '*' ? locale : defaultLocale,\n ...this.collation,\n }\n }\n\n if (!useEstimatedCount && Object.keys(query).length === 0 && this.disableIndexHints !== true) {\n // Improve the performance of the countDocuments query which is used if useEstimatedCount is set to false by adding\n // a hint. By default, if no hint is provided, MongoDB does not use an indexed field to count the returned documents,\n // which makes queries very slow. This only happens when no query (filter) is provided. If one is provided, it uses\n // the correct indexed field\n paginationOptions.useCustomCountFn = () => {\n return Promise.resolve(\n Model.countDocuments(query, {\n hint: { _id: 1 },\n session,\n }),\n )\n }\n }\n\n if (limit >= 0) {\n paginationOptions.limit = limit\n // limit must also be set here, it's ignored when pagination is false\n\n paginationOptions.options!.limit = limit\n\n // Disable pagination if limit is 0\n if (limit === 0) {\n paginationOptions.pagination = false\n }\n }\n\n let result\n\n const aggregate = await buildJoinAggregation({\n adapter: this,\n collection: collectionSlug,\n collectionConfig,\n draftsEnabled,\n joins,\n locale,\n query,\n })\n\n if (aggregate || sortAggregation.length > 0) {\n result = await aggregatePaginate({\n adapter: this,\n collation: paginationOptions.collation,\n joinAggregation: aggregate,\n limit: paginationOptions.limit,\n Model,\n page: paginationOptions.page,\n pagination: paginationOptions.pagination,\n projection: paginationOptions.projection,\n query,\n session: paginationOptions.options?.session ?? undefined,\n sort: paginationOptions.sort as object,\n sortAggregation,\n useEstimatedCount: paginationOptions.useEstimatedCount,\n })\n } else {\n result = await Model.paginate(query, paginationOptions)\n }\n\n if (!this.useJoinAggregations) {\n await resolveJoins({\n adapter: this,\n collectionSlug,\n docs: result.docs as Record<string, unknown>[],\n joins,\n locale,\n })\n }\n\n transform({\n adapter: this,\n data: result.docs,\n fields: collectionConfig.fields,\n operation: 'read',\n })\n\n return result\n}\n"],"names":["flattenWhereToOperators","buildQuery","buildSortParam","aggregatePaginate","buildJoinAggregation","buildProjectionFromSelect","getCollection","getSession","resolveJoins","transform","find","collection","collectionSlug","draftsEnabled","joins","limit","locale","page","pagination","projection","req","select","sort","sortArg","where","collectionConfig","Model","adapter","session","hasNearConstraint","constraints","some","prop","Object","keys","key","sortAggregation","config","payload","fields","flattenedFields","defaultSort","timestamps","query","useEstimatedCount","length","paginationOptions","lean","leanWithId","options","collation","defaultLocale","disableIndexHints","useCustomCountFn","Promise","resolve","countDocuments","hint","_id","result","aggregate","joinAggregation","undefined","paginate","useJoinAggregations","docs","data","operation"],"mappings":"AAGA,SAASA,uBAAuB,QAAQ,UAAS;AAIjD,SAASC,UAAU,QAAQ,0BAAyB;AACpD,SAASC,cAAc,QAAQ,8BAA6B;AAC5D,SAASC,iBAAiB,QAAQ,mCAAkC;AACpE,SAASC,oBAAoB,QAAQ,sCAAqC;AAC1E,SAASC,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,aAAa,QAAQ,2BAA0B;AACxD,SAASC,UAAU,QAAQ,4BAA2B;AACtD,SAASC,YAAY,QAAQ,8BAA6B;AAC1D,SAASC,SAAS,QAAQ,2BAA0B;AAEpD,OAAO,MAAMC,OAAa,eAAeA,KAEvC,EACEC,YAAYC,cAAc,EAC1BC,aAAa,EACbC,QAAQ,CAAC,CAAC,EACVC,QAAQ,CAAC,EACTC,MAAM,EACNC,IAAI,EACJC,UAAU,EACVC,UAAU,EACVC,GAAG,EACHC,MAAM,EACNC,MAAMC,OAAO,EACbC,QAAQ,CAAC,CAAC,EACX;IAED,MAAM,EAAEC,gBAAgB,EAAEC,KAAK,EAAE,GAAGpB,cAAc;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QACRkB,SAAS,IAAI;QACbuC,MAAMP,OAAOM,IAAI;QACjB1B,QAAQd,iBAAiBc,MAAM;QAC/B4B,WAAW;IACb;IAEA,OAAOR;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findDistinct.d.ts","sourceRoot":"","sources":["../src/findDistinct.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,SAAS,CAAA;AAS3D,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"findDistinct.d.ts","sourceRoot":"","sources":["../src/findDistinct.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,SAAS,CAAA;AAS3D,eAAO,MAAM,YAAY,EAAE,YA6J1B,CAAA"}
|
package/dist/findDistinct.js
CHANGED
|
@@ -41,25 +41,16 @@ export const findDistinct = async function(args) {
|
|
|
41
41
|
;
|
|
42
42
|
const sortDirection = sort[sortProperty] === 'asc' ? 1 : -1;
|
|
43
43
|
let $unwind = '';
|
|
44
|
-
let $group
|
|
44
|
+
let $group;
|
|
45
45
|
if (isHasManyValue && sortAggregation.length && sortAggregation[0] && '$lookup' in sortAggregation[0]) {
|
|
46
|
-
$unwind = {
|
|
47
|
-
path: `$${sortAggregation[0].$lookup.as}`,
|
|
48
|
-
preserveNullAndEmptyArrays: true
|
|
49
|
-
};
|
|
46
|
+
$unwind = `$${sortAggregation[0].$lookup.as}`;
|
|
50
47
|
$group = {
|
|
51
48
|
_id: {
|
|
52
49
|
_field: `$${sortAggregation[0].$lookup.as}._id`,
|
|
53
50
|
_sort: `$${sortProperty}`
|
|
54
51
|
}
|
|
55
52
|
};
|
|
56
|
-
} else
|
|
57
|
-
$unwind = {
|
|
58
|
-
path: `$${args.field}`,
|
|
59
|
-
preserveNullAndEmptyArrays: true
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
if (!$group) {
|
|
53
|
+
} else {
|
|
63
54
|
$group = {
|
|
64
55
|
_id: {
|
|
65
56
|
_field: `$${fieldPath}`,
|
package/dist/findDistinct.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/findDistinct.ts"],"sourcesContent":["import type { PipelineStage } from 'mongoose'\n\nimport { type FindDistinct, getFieldByPath } from 'payload'\n\nimport type { MongooseAdapter } from './index.js'\n\nimport { buildQuery } from './queries/buildQuery.js'\nimport { buildSortParam } from './queries/buildSortParam.js'\nimport { getCollection } from './utilities/getEntity.js'\nimport { getSession } from './utilities/getSession.js'\n\nexport const findDistinct: FindDistinct = async function (this: MongooseAdapter, args) {\n const { collectionConfig, Model } = getCollection({\n adapter: this,\n collectionSlug: args.collection,\n })\n\n const session = await getSession(this, args.req)\n\n const { where = {} } = args\n\n const sortAggregation: PipelineStage[] = []\n\n const sort = buildSortParam({\n adapter: this,\n config: this.payload.config,\n fields: collectionConfig.flattenedFields,\n locale: args.locale,\n sort: args.sort ?? args.field,\n sortAggregation,\n timestamps: true,\n })\n\n const query = await buildQuery({\n adapter: this,\n collectionSlug: args.collection,\n fields: collectionConfig.flattenedFields,\n locale: args.locale,\n where,\n })\n\n const fieldPathResult = getFieldByPath({\n fields: collectionConfig.flattenedFields,\n path: args.field,\n })\n let fieldPath = args.field\n if (fieldPathResult?.pathHasLocalized && args.locale) {\n fieldPath = fieldPathResult.localizedPath.replace('<locale>', args.locale)\n }\n\n const isHasManyValue =\n fieldPathResult && 'hasMany' in fieldPathResult.field && fieldPathResult.field.hasMany\n\n const page = args.page || 1\n\n const sortProperty = Object.keys(sort)[0]! // assert because buildSortParam always returns at least 1 key.\n const sortDirection = sort[sortProperty] === 'asc' ? 1 : -1\n\n let $unwind:
|
|
1
|
+
{"version":3,"sources":["../src/findDistinct.ts"],"sourcesContent":["import type { PipelineStage } from 'mongoose'\n\nimport { type FindDistinct, getFieldByPath } from 'payload'\n\nimport type { MongooseAdapter } from './index.js'\n\nimport { buildQuery } from './queries/buildQuery.js'\nimport { buildSortParam } from './queries/buildSortParam.js'\nimport { getCollection } from './utilities/getEntity.js'\nimport { getSession } from './utilities/getSession.js'\n\nexport const findDistinct: FindDistinct = async function (this: MongooseAdapter, args) {\n const { collectionConfig, Model } = getCollection({\n adapter: this,\n collectionSlug: args.collection,\n })\n\n const session = await getSession(this, args.req)\n\n const { where = {} } = args\n\n const sortAggregation: PipelineStage[] = []\n\n const sort = buildSortParam({\n adapter: this,\n config: this.payload.config,\n fields: collectionConfig.flattenedFields,\n locale: args.locale,\n sort: args.sort ?? args.field,\n sortAggregation,\n timestamps: true,\n })\n\n const query = await buildQuery({\n adapter: this,\n collectionSlug: args.collection,\n fields: collectionConfig.flattenedFields,\n locale: args.locale,\n where,\n })\n\n const fieldPathResult = getFieldByPath({\n fields: collectionConfig.flattenedFields,\n path: args.field,\n })\n let fieldPath = args.field\n if (fieldPathResult?.pathHasLocalized && args.locale) {\n fieldPath = fieldPathResult.localizedPath.replace('<locale>', args.locale)\n }\n\n const isHasManyValue =\n fieldPathResult && 'hasMany' in fieldPathResult.field && fieldPathResult.field.hasMany\n\n const page = args.page || 1\n\n const sortProperty = Object.keys(sort)[0]! // assert because buildSortParam always returns at least 1 key.\n const sortDirection = sort[sortProperty] === 'asc' ? 1 : -1\n\n let $unwind: string = ''\n let $group: any\n if (\n isHasManyValue &&\n sortAggregation.length &&\n sortAggregation[0] &&\n '$lookup' in sortAggregation[0]\n ) {\n $unwind = `$${sortAggregation[0].$lookup.as}`\n $group = {\n _id: {\n _field: `$${sortAggregation[0].$lookup.as}._id`,\n _sort: `$${sortProperty}`,\n },\n }\n } else {\n $group = {\n _id: {\n _field: `$${fieldPath}`,\n ...(sortProperty === fieldPath\n ? {}\n : {\n _sort: `$${sortProperty}`,\n }),\n },\n }\n }\n\n const pipeline: PipelineStage[] = [\n {\n $match: query,\n },\n ...(sortAggregation.length > 0 ? sortAggregation : []),\n ...($unwind\n ? [\n {\n $unwind,\n },\n ]\n : []),\n {\n $group,\n },\n {\n $sort: {\n [sortProperty === fieldPath ? '_id._field' : '_id._sort']: sortDirection,\n },\n },\n ]\n\n const getValues = async () => {\n return Model.aggregate(pipeline, { session }).then((res) =>\n res.map((each) => ({\n [args.field]: JSON.parse(JSON.stringify(each._id._field)),\n })),\n )\n }\n\n if (args.limit) {\n pipeline.push({\n $skip: (page - 1) * args.limit,\n })\n pipeline.push({ $limit: args.limit })\n const totalDocs = await Model.aggregate(\n [\n {\n $match: query,\n },\n {\n $group: {\n _id: `$${fieldPath}`,\n },\n },\n { $count: 'count' },\n ],\n {\n session,\n },\n ).then((res) => res[0]?.count ?? 0)\n const totalPages = Math.ceil(totalDocs / args.limit)\n const hasPrevPage = page > 1\n const hasNextPage = totalPages > page\n const pagingCounter = (page - 1) * args.limit + 1\n\n return {\n hasNextPage,\n hasPrevPage,\n limit: args.limit,\n nextPage: hasNextPage ? page + 1 : null,\n page,\n pagingCounter,\n prevPage: hasPrevPage ? page - 1 : null,\n totalDocs,\n totalPages,\n values: await getValues(),\n }\n }\n\n const values = await getValues()\n\n return {\n hasNextPage: false,\n hasPrevPage: false,\n limit: 0,\n page: 1,\n pagingCounter: 1,\n totalDocs: values.length,\n totalPages: 1,\n values,\n }\n}\n"],"names":["getFieldByPath","buildQuery","buildSortParam","getCollection","getSession","findDistinct","args","collectionConfig","Model","adapter","collectionSlug","collection","session","req","where","sortAggregation","sort","config","payload","fields","flattenedFields","locale","field","timestamps","query","fieldPathResult","path","fieldPath","pathHasLocalized","localizedPath","replace","isHasManyValue","hasMany","page","sortProperty","Object","keys","sortDirection","$unwind","$group","length","$lookup","as","_id","_field","_sort","pipeline","$match","$sort","getValues","aggregate","then","res","map","each","JSON","parse","stringify","limit","push","$skip","$limit","totalDocs","$count","count","totalPages","Math","ceil","hasPrevPage","hasNextPage","pagingCounter","nextPage","prevPage","values"],"mappings":"AAEA,SAA4BA,cAAc,QAAQ,UAAS;AAI3D,SAASC,UAAU,QAAQ,0BAAyB;AACpD,SAASC,cAAc,QAAQ,8BA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AC3B,CAAAA,OAAO,CAAA,IAAK3B,KAAKoD,KAAK;QAChC;QACAZ,SAASa,IAAI,CAAC;YAAEE,QAAQvD,KAAKoD,KAAK;QAAC;QACnC,MAAMI,YAAY,MAAMtD,MAAM0C,SAAS,CACrC;YACE;gBACEH,QAAQvB;YACV;YACA;gBACEe,QAAQ;oBACNI,KAAK,CAAC,CAAC,EAAEhB,WAAW;gBACtB;YACF;YACA;gBAAEoC,QAAQ;YAAQ;SACnB,EACD;YACEnD;QACF,GACAuC,IAAI,CAAC,CAACC,MAAQA,GAAG,CAAC,EAAE,EAAEY,SAAS;QACjC,MAAMC,aAAaC,KAAKC,IAAI,CAACL,YAAYxD,KAAKoD,KAAK;QACnD,MAAMU,cAAcnC,OAAO;QAC3B,MAAMoC,cAAcJ,aAAahC;QACjC,MAAMqC,gBAAgB,AAACrC,CAAAA,OAAO,CAAA,IAAK3B,KAAKoD,KAAK,GAAG;QAEhD,OAAO;YACLW;YACAD;YACAV,OAAOpD,KAAKoD,KAAK;YACjBa,UAAUF,cAAcpC,OAAO,IAAI;YACnCA;YACAqC;YACAE,UAAUJ,cAAcnC,OAAO,IAAI;YACnC6B;YACAG;YACAQ,QAAQ,MAAMxB;QAChB;IACF;IAEA,MAAMwB,SAAS,MAAMxB;IAErB,OAAO;QACLoB,aAAa;QACbD,aAAa;QACbV,OAAO;QACPzB,MAAM;QACNqC,eAAe;QACfR,WAAWW,OAAOjC,MAAM;QACxByB,YAAY;QACZQ;IACF;AACF,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/db-mongodb",
|
|
3
|
-
"version": "3.57.0-
|
|
3
|
+
"version": "3.57.0-internal.1d2ebbc",
|
|
4
4
|
"description": "The officially supported MongoDB database adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"mongodb": "6.16.0",
|
|
51
51
|
"mongodb-memory-server": "10.1.4",
|
|
52
52
|
"@payloadcms/eslint-config": "3.28.0",
|
|
53
|
-
"payload": "3.57.0-
|
|
53
|
+
"payload": "3.57.0-internal.1d2ebbc"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"payload": "3.57.0-
|
|
56
|
+
"payload": "3.57.0-internal.1d2ebbc"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "pnpm build:types && pnpm build:swc",
|