@payloadcms/db-mongodb 3.39.0-canary.3 → 3.39.0-canary.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"buildSortParam.d.ts","sourceRoot":"","sources":["../../src/queries/buildSortParam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,eAAe,EACpB,KAAK,IAAI,EACV,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAKlD,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,EAAE,IAAI,CAAA;IACV,eAAe,CAAC,EAAE,aAAa,EAAE,CAAA;IACjC,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;CACjB,EAAE,CAAA;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAA;AAiG1C,eAAO,MAAM,cAAc,yGAUxB,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAyD9B,CAAA"}
1
+ {"version":3,"file":"buildSortParam.d.ts","sourceRoot":"","sources":["../../src/queries/buildSortParam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,eAAe,EACpB,KAAK,IAAI,EACV,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAKlD,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,EAAE,IAAI,CAAA;IACV,eAAe,CAAC,EAAE,aAAa,EAAE,CAAA;IACjC,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;CACjB,EAAE,CAAA;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAA;AAiG1C,eAAO,MAAM,cAAc,yGAUxB,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAqE9B,CAAA"}
@@ -77,6 +77,15 @@ export const buildSortParam = ({ adapter, config, fields, locale, parentIsLocali
77
77
  sort
78
78
  ];
79
79
  }
80
+ // In the case of Mongo, when sorting by a field that is not unique, the results are not guaranteed to be in the same order each time.
81
+ // So we add a fallback sort to ensure that the results are always in the same order.
82
+ let fallbackSort = '-id';
83
+ if (timestamps) {
84
+ fallbackSort = '-createdAt';
85
+ }
86
+ if (!(sort.includes(fallbackSort) || sort.includes(fallbackSort.replace('-', '')))) {
87
+ sort.push(fallbackSort);
88
+ }
80
89
  const sorting = sort.reduce((acc, item)=>{
81
90
  let sortProperty;
82
91
  let sortDirection;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/queries/buildSortParam.ts"],"sourcesContent":["import type { PipelineStage } from 'mongoose'\n\nimport {\n APIError,\n type FlattenedField,\n getFieldByPath,\n type SanitizedConfig,\n type Sort,\n} from 'payload'\n\nimport type { MongooseAdapter } from '../index.js'\n\nimport { getCollection } from '../utilities/getEntity.js'\nimport { getLocalizedSortProperty } from './getLocalizedSortProperty.js'\n\ntype Args = {\n adapter: MongooseAdapter\n config: SanitizedConfig\n fields: FlattenedField[]\n locale?: string\n parentIsLocalized?: boolean\n sort: Sort\n sortAggregation?: PipelineStage[]\n timestamps: boolean\n versions?: boolean\n}\n\nexport type SortArgs = {\n direction: SortDirection\n property: string\n}[]\n\nexport type SortDirection = 'asc' | 'desc'\n\nconst relationshipSort = ({\n adapter,\n fields,\n locale,\n path,\n sort,\n sortAggregation,\n sortDirection,\n versions,\n}: {\n adapter: MongooseAdapter\n fields: FlattenedField[]\n locale?: string\n path: string\n sort: Record<string, string>\n sortAggregation: PipelineStage[]\n sortDirection: SortDirection\n versions?: boolean\n}) => {\n let currentFields = fields\n const segments = path.split('.')\n if (segments.length < 2) {\n return false\n }\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i]\n const field = currentFields.find((each) => each.name === segment)\n\n if (!field) {\n return false\n }\n\n if ('fields' in field) {\n currentFields = field.flattenedFields\n if (field.name === 'version' && versions && i === 0) {\n segments.shift()\n i--\n }\n } else if (\n (field.type === 'relationship' || field.type === 'upload') &&\n i !== segments.length - 1\n ) {\n const relationshipPath = segments.slice(0, i + 1).join('.')\n let sortFieldPath = segments.slice(i + 1, segments.length).join('.')\n if (Array.isArray(field.relationTo)) {\n throw new APIError('Not supported')\n }\n\n const foreignCollection = getCollection({ adapter, collectionSlug: field.relationTo })\n\n const foreignFieldPath = getFieldByPath({\n fields: foreignCollection.collectionConfig.flattenedFields,\n path: sortFieldPath,\n })\n\n if (!foreignFieldPath) {\n return false\n }\n\n if (foreignFieldPath.pathHasLocalized && locale) {\n sortFieldPath = foreignFieldPath.localizedPath.replace('<locale>', locale)\n }\n\n if (\n !sortAggregation.some((each) => {\n return '$lookup' in each && each.$lookup.as === `__${path}`\n })\n ) {\n sortAggregation.push({\n $lookup: {\n as: `__${path}`,\n foreignField: '_id',\n from: foreignCollection.Model.collection.name,\n localField: versions ? `version.${relationshipPath}` : relationshipPath,\n pipeline: [\n {\n $project: {\n [sortFieldPath]: true,\n },\n },\n ],\n },\n })\n\n sort[`__${path}.${sortFieldPath}`] = sortDirection\n\n return true\n }\n }\n }\n\n return false\n}\n\nexport const buildSortParam = ({\n adapter,\n config,\n fields,\n locale,\n parentIsLocalized = false,\n sort,\n sortAggregation,\n timestamps,\n versions,\n}: Args): Record<string, string> => {\n if (!sort) {\n if (timestamps) {\n sort = '-createdAt'\n } else {\n sort = '-id'\n }\n }\n\n if (typeof sort === 'string') {\n sort = [sort]\n }\n\n const sorting = sort.reduce<Record<string, string>>((acc, item) => {\n let sortProperty: string\n let sortDirection: SortDirection\n if (item.indexOf('-') === 0) {\n sortProperty = item.substring(1)\n sortDirection = 'desc'\n } else {\n sortProperty = item\n sortDirection = 'asc'\n }\n if (sortProperty === 'id') {\n acc['_id'] = sortDirection\n return acc\n }\n\n if (\n sortAggregation &&\n relationshipSort({\n adapter,\n fields,\n locale,\n path: sortProperty,\n sort: acc,\n sortAggregation,\n sortDirection,\n versions,\n })\n ) {\n return acc\n }\n\n const localizedProperty = getLocalizedSortProperty({\n config,\n fields,\n locale,\n parentIsLocalized,\n segments: sortProperty.split('.'),\n })\n acc[localizedProperty] = sortDirection\n\n return acc\n }, {})\n\n return sorting\n}\n"],"names":["APIError","getFieldByPath","getCollection","getLocalizedSortProperty","relationshipSort","adapter","fields","locale","path","sort","sortAggregation","sortDirection","versions","currentFields","segments","split","length","i","segment","field","find","each","name","flattenedFields","shift","type","relationshipPath","slice","join","sortFieldPath","Array","isArray","relationTo","foreignCollection","collectionSlug","foreignFieldPath","collectionConfig","pathHasLocalized","localizedPath","replace","some","$lookup","as","push","foreignField","from","Model","collection","localField","pipeline","$project","buildSortParam","config","parentIsLocalized","timestamps","sorting","reduce","acc","item","sortProperty","indexOf","substring","localizedProperty"],"mappings":"AAEA,SACEA,QAAQ,EAERC,cAAc,QAG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AC;YAC9BlD,gBAAgB;QAClB,OAAO;YACLgD,eAAeD;YACf/C,gBAAgB;QAClB;QACA,IAAIgD,iBAAiB,MAAM;YACzBF,GAAG,CAAC,MAAM,GAAG9C;YACb,OAAO8C;QACT;QAEA,IACE/C,mBACAN,iBAAiB;YACfC;YACAC;YACAC;YACAC,MAAMmD;YACNlD,MAAMgD;YACN/C;YACAC;YACAC;QACF,IACA;YACA,OAAO6C;QACT;QAEA,MAAMK,oBAAoB3D,yBAAyB;YACjDiD;YACA9C;YACAC;YACA8C;YACAvC,UAAU6C,aAAa5C,KAAK,CAAC;QAC/B;QACA0C,GAAG,CAACK,kBAAkB,GAAGnD;QAEzB,OAAO8C;IACT,GAAG,CAAC;IAEJ,OAAOF;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/queries/buildSortParam.ts"],"sourcesContent":["import type { PipelineStage } from 'mongoose'\n\nimport {\n APIError,\n type FlattenedField,\n getFieldByPath,\n type SanitizedConfig,\n type Sort,\n} from 'payload'\n\nimport type { MongooseAdapter } from '../index.js'\n\nimport { getCollection } from '../utilities/getEntity.js'\nimport { getLocalizedSortProperty } from './getLocalizedSortProperty.js'\n\ntype Args = {\n adapter: MongooseAdapter\n config: SanitizedConfig\n fields: FlattenedField[]\n locale?: string\n parentIsLocalized?: boolean\n sort: Sort\n sortAggregation?: PipelineStage[]\n timestamps: boolean\n versions?: boolean\n}\n\nexport type SortArgs = {\n direction: SortDirection\n property: string\n}[]\n\nexport type SortDirection = 'asc' | 'desc'\n\nconst relationshipSort = ({\n adapter,\n fields,\n locale,\n path,\n sort,\n sortAggregation,\n sortDirection,\n versions,\n}: {\n adapter: MongooseAdapter\n fields: FlattenedField[]\n locale?: string\n path: string\n sort: Record<string, string>\n sortAggregation: PipelineStage[]\n sortDirection: SortDirection\n versions?: boolean\n}) => {\n let currentFields = fields\n const segments = path.split('.')\n if (segments.length < 2) {\n return false\n }\n\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i]\n const field = currentFields.find((each) => each.name === segment)\n\n if (!field) {\n return false\n }\n\n if ('fields' in field) {\n currentFields = field.flattenedFields\n if (field.name === 'version' && versions && i === 0) {\n segments.shift()\n i--\n }\n } else if (\n (field.type === 'relationship' || field.type === 'upload') &&\n i !== segments.length - 1\n ) {\n const relationshipPath = segments.slice(0, i + 1).join('.')\n let sortFieldPath = segments.slice(i + 1, segments.length).join('.')\n if (Array.isArray(field.relationTo)) {\n throw new APIError('Not supported')\n }\n\n const foreignCollection = getCollection({ adapter, collectionSlug: field.relationTo })\n\n const foreignFieldPath = getFieldByPath({\n fields: foreignCollection.collectionConfig.flattenedFields,\n path: sortFieldPath,\n })\n\n if (!foreignFieldPath) {\n return false\n }\n\n if (foreignFieldPath.pathHasLocalized && locale) {\n sortFieldPath = foreignFieldPath.localizedPath.replace('<locale>', locale)\n }\n\n if (\n !sortAggregation.some((each) => {\n return '$lookup' in each && each.$lookup.as === `__${path}`\n })\n ) {\n sortAggregation.push({\n $lookup: {\n as: `__${path}`,\n foreignField: '_id',\n from: foreignCollection.Model.collection.name,\n localField: versions ? `version.${relationshipPath}` : relationshipPath,\n pipeline: [\n {\n $project: {\n [sortFieldPath]: true,\n },\n },\n ],\n },\n })\n\n sort[`__${path}.${sortFieldPath}`] = sortDirection\n\n return true\n }\n }\n }\n\n return false\n}\n\nexport const buildSortParam = ({\n adapter,\n config,\n fields,\n locale,\n parentIsLocalized = false,\n sort,\n sortAggregation,\n timestamps,\n versions,\n}: Args): Record<string, string> => {\n if (!sort) {\n if (timestamps) {\n sort = '-createdAt'\n } else {\n sort = '-id'\n }\n }\n\n if (typeof sort === 'string') {\n sort = [sort]\n }\n\n // In the case of Mongo, when sorting by a field that is not unique, the results are not guaranteed to be in the same order each time.\n // So we add a fallback sort to ensure that the results are always in the same order.\n let fallbackSort = '-id'\n\n if (timestamps) {\n fallbackSort = '-createdAt'\n }\n\n if (!(sort.includes(fallbackSort) || sort.includes(fallbackSort.replace('-', '')))) {\n sort.push(fallbackSort)\n }\n\n const sorting = sort.reduce<Record<string, string>>((acc, item) => {\n let sortProperty: string\n let sortDirection: SortDirection\n if (item.indexOf('-') === 0) {\n sortProperty = item.substring(1)\n sortDirection = 'desc'\n } else {\n sortProperty = item\n sortDirection = 'asc'\n }\n if (sortProperty === 'id') {\n acc['_id'] = sortDirection\n return acc\n }\n\n if (\n sortAggregation &&\n relationshipSort({\n adapter,\n fields,\n locale,\n path: sortProperty,\n sort: acc,\n sortAggregation,\n sortDirection,\n versions,\n })\n ) {\n return acc\n }\n\n const localizedProperty = getLocalizedSortProperty({\n config,\n fields,\n locale,\n parentIsLocalized,\n segments: sortProperty.split('.'),\n })\n acc[localizedProperty] = sortDirection\n\n return acc\n }, {})\n\n return sorting\n}\n"],"names":["APIError","getFieldByPath","getCollection","getLocalizedSortProperty","relationshipSort","adapter","fields","locale","path","sort","sortAggregation","sortDirection","versions","currentFields","segments","split","length","i","segment","field","find","each","name","flattenedFields","shift","type","relationshipPath","slice","join","sortFieldPath","Array","isArray","relationTo","foreignCollection","collectionSlug","foreignFieldPath","collectionConfig","pathHasLocalized","localizedPath","replace","some","$lookup","as","push","foreignField","from","Model","collection","localField","pipeline","$project","buildSortParam","config","parentIsLocalized","timestamps","fallbackSort","includes","sorting","reduce","acc","item","sortProperty","indexOf","substring","localizedProperty"],"mappings":"AAEA,SACEA,QAAQ,EAERC,cAAc,QAGT,UAAS;AAIhB,SAASC,aAAa,QAAQ,4BAA2B;AACzD,SAASC,wBAAwB,QAAQ,gCAA+B;AAqBxE,MAAMC,mBAAmB,CAAC,EACxBC,OAAO,EACPC,MAAM,EACNC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,eAAe,EACfC,aAAa,EACbC,QAAQ,EAUT;IACC,IAAIC,gBAAgBP;IACpB,MAAMQ,WAAWN,KAAKO,KAAK,CAAC;IAC5B,IAAID,SAASE,MAAM,GAAG,GAAG;QACvB,OAAO;IACT;IAEA,IAAK,IAAIC,IAAI,GAAGA,IAAIH,SAASE,MAAM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;QACT;QAEA,IACEjD,mBACAN,iBAAiB;YACfC;YACAC;YACAC;YACAC,MAAMqD;YACNpD,MAAMkD;YACNjD;YACAC;YACAC;QACF,IACA;YACA,OAAO+C;QACT;QAEA,MAAMK,oBAAoB7D,yBAAyB;YACjDiD;YACA9C;YACAC;YACA8C;YACAvC,UAAU+C,aAAa9C,KAAK,CAAC;QAC/B;QACA4C,GAAG,CAACK,kBAAkB,GAAGrD;QAEzB,OAAOgD;IACT,GAAG,CAAC;IAEJ,OAAOF;AACT,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/db-mongodb",
3
- "version": "3.39.0-canary.3",
3
+ "version": "3.39.0-canary.5",
4
4
  "description": "The officially supported MongoDB database adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -48,11 +48,11 @@
48
48
  "@types/uuid": "10.0.0",
49
49
  "mongodb": "6.12.0",
50
50
  "mongodb-memory-server": "^10",
51
- "payload": "3.39.0-canary.3",
52
- "@payloadcms/eslint-config": "3.28.0"
51
+ "@payloadcms/eslint-config": "3.28.0",
52
+ "payload": "3.39.0-canary.5"
53
53
  },
54
54
  "peerDependencies": {
55
- "payload": "3.39.0-canary.3"
55
+ "payload": "3.39.0-canary.5"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "pnpm build:types && pnpm build:swc",