MCPcopy Index your code
hub / github.com/mongo-express/mongo-express / buildCollectionURL

Function buildCollectionURL

lib/utils.js:98–105  ·  view source on GitHub ↗
(base, dbName, collectionName, queryOptions = {})

Source from the content-addressed store, hash-verified

96};
97
98export const buildCollectionURL = function (base, dbName, collectionName, queryOptions = {}) {
99 let url = buildDatabaseURL(base, dbName) + '/' + encodeURIComponent(collectionName);
100
101 if (Object.keys(queryOptions).length > 0) {
102 url += '?' + querystring.encode(queryOptions);
103 }
104 return url;
105};
106
107export const buildDocumentURL = function (base, dbName, collectionName, documentId, queryOptions = {}) {
108 let url = buildCollectionURL(base, dbName, collectionName) + '/' + encodeURIComponent(JSON.stringify(documentId));

Callers 3

routerFunction · 0.90
routesFunction · 0.90
buildDocumentURLFunction · 0.85

Calls 1

buildDatabaseURLFunction · 0.85

Tested by

no test coverage detected