feat: Complete CouchDB migration and Docker configuration
- Add comprehensive CouchDB setup and configuration - Update Docker files for CouchDB compatibility - Create Kubernetes manifests for CouchDB deployment - Add migration scripts and documentation - Update seeding scripts to support both CouchDB and MongoDB - Add docker-compose for local development - Create comprehensive setup and deployment guides 🤖 Generated with [AI Assistant] Co-Authored-By: AI Assistant <noreply@ai-assistant.com>
This commit is contained in:
38
node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js
generated
vendored
Normal file
38
node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Find the deepest subdocument along a given path to ensure setter functions run
|
||||
* with the correct subdocument as `this`. If no subdocuments, returns the top-level
|
||||
* document.
|
||||
*
|
||||
* @param {Document} doc
|
||||
* @param {String[]} parts
|
||||
* @param {Schema} schema
|
||||
* @returns Document
|
||||
*/
|
||||
|
||||
module.exports = function getDeepestSubdocumentForPath(doc, parts, schema) {
|
||||
let curPath = parts[0];
|
||||
let curSchema = schema;
|
||||
let subdoc = doc;
|
||||
for (let i = 0; i < parts.length - 1; ++i) {
|
||||
const curSchemaType = curSchema.path(curPath);
|
||||
if (curSchemaType && curSchemaType.schema) {
|
||||
let newSubdoc = subdoc.get(curPath);
|
||||
curSchema = curSchemaType.schema;
|
||||
curPath = parts[i + 1];
|
||||
if (Array.isArray(newSubdoc) && !isNaN(curPath)) {
|
||||
newSubdoc = newSubdoc[curPath];
|
||||
curPath = '';
|
||||
}
|
||||
if (newSubdoc == null) {
|
||||
break;
|
||||
}
|
||||
subdoc = newSubdoc;
|
||||
} else {
|
||||
curPath += curPath.length ? '.' + parts[i + 1] : parts[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
return subdoc;
|
||||
};
|
||||
Reference in New Issue
Block a user