started mongo stuff, but it's a PITA. fuck mongo
This commit is contained in:
parent
4cd36ea3fc
commit
0f1bc5dff3
937 changed files with 205043 additions and 0 deletions
11
parts/3/phonebookBackend/node_modules/mquery/.github/ISSUE_TEMPLATE.md
generated
vendored
Normal file
11
parts/3/phonebookBackend/node_modules/mquery/.github/ISSUE_TEMPLATE.md
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!-- *Before creating an issue please make sure you are using the latest version of mquery -->
|
||||
|
||||
**Do you want to request a *feature* or report a *bug*?**
|
||||
|
||||
**What is the current behavior?**
|
||||
|
||||
**If the current behavior is a bug, please provide the steps to reproduce.**
|
||||
|
||||
**What is the expected behavior?**
|
||||
|
||||
**What are the versions of Node.js and mquery are you are using? Note that "latest" is not a version.**
|
||||
9
parts/3/phonebookBackend/node_modules/mquery/.github/PULL_REQUEST_TEMPLATE.md
generated
vendored
Normal file
9
parts/3/phonebookBackend/node_modules/mquery/.github/PULL_REQUEST_TEMPLATE.md
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory.-->
|
||||
|
||||
**Summary**
|
||||
|
||||
<!-- Explain the **motivation** for making this change. What problem does the pull request solve? -->
|
||||
|
||||
**Examples**
|
||||
|
||||
<!-- If this code fixes a bug or adds a new feature, provide an example demonstrating the change, unless you added a test. -->
|
||||
384
parts/3/phonebookBackend/node_modules/mquery/History.md
generated
vendored
Normal file
384
parts/3/phonebookBackend/node_modules/mquery/History.md
generated
vendored
Normal file
|
|
@ -0,0 +1,384 @@
|
|||
5.0.0 / 2023-02-23
|
||||
==================
|
||||
* BREAKING CHANGE: drop callback support #137 [hasezoey](https://github.com/hasezoey)
|
||||
* BREAKING CHANGE: remove custom promise library support #137 [hasezoey](https://github.com/hasezoey)
|
||||
* BREAKING CHANGE: remove long deprecated `update`, `remove` functions #136 [hasezoey](https://github.com/hasezoey)
|
||||
* BREAKING CHANGE: remove collection ducktyping: first param to `mquery()` is now always the query filter #138
|
||||
* feat: support MongoDB Node driver 5 #137 [hasezoey](https://github.com/hasezoey)
|
||||
|
||||
4.0.3 / 2022-05-17
|
||||
==================
|
||||
* fix: allow using `comment` with `findOneAndUpdate()`, `count()`, `distinct()` and `hint` with `findOneAndUpdate()` Automattic/mongoose#11793
|
||||
|
||||
4.0.2 / 2022-01-23
|
||||
==================
|
||||
* perf: replace regexp-clone with native functionality #131 [Uzlopak](https://github.com/Uzlopak)
|
||||
|
||||
4.0.1 / 2022-01-20
|
||||
==================
|
||||
* perf: remove sliced, add various microoptimizations #130 [Uzlopak](https://github.com/Uzlopak)
|
||||
* refactor: convert NodeCollection to a class #128 [jimmywarting](https://github.com/jimmywarting)
|
||||
|
||||
4.0.0 / 2021-08-24
|
||||
|
||||
4.0.0-rc0 / 2021-08-19
|
||||
======================
|
||||
* BREAKING CHANGE: drop support for Node < 12 #123
|
||||
* BREAKING CHANGE: upgrade to mongodb driver 4.x: drop support for `findAndModify()`, use native `findOneAndUpdate/Delete` #124
|
||||
* BREAKING CHANGE: rename findStream -> findCursor #124
|
||||
* BREAKING CHANGE: use native ES6 promises by default, remove bluebird dependency #123
|
||||
|
||||
3.2.5 / 2021-03-29
|
||||
==================
|
||||
* fix(utils): make `mergeClone()` skip special properties like `__proto__` #121 [zpbrent](https://github.com/zpbrent)
|
||||
|
||||
3.2.4 / 2021-02-12
|
||||
==================
|
||||
* fix(utils): make clone() only copy own properties Automattic/mongoose#9876
|
||||
|
||||
3.2.3 / 2020-12-10
|
||||
==================
|
||||
* fix(utils): avoid copying special properties like `__proto__` when merging and cloning. Fix CVE-2020-35149
|
||||
|
||||
3.2.2 / 2019-09-22
|
||||
==================
|
||||
* fix: dont re-call setOptions() when pulling base class options Automattic/mongoose#8159
|
||||
|
||||
3.2.1 / 2018-08-24
|
||||
==================
|
||||
* chore: upgrade deps
|
||||
|
||||
3.2.0 / 2018-08-24
|
||||
==================
|
||||
* feat: add $useProjection to opt in to using `projection` instead of `fields` re: MongoDB deprecation warnings Automattic/mongoose#6880
|
||||
|
||||
3.1.2 / 2018-08-01
|
||||
==================
|
||||
* chore: move eslint to devDependencies #110 [jakesjews](https://github.com/jakesjews)
|
||||
|
||||
3.1.1 / 2018-07-30
|
||||
==================
|
||||
* chore: add eslint #107 [Fonger](https://github.com/Fonger)
|
||||
* docs: clean up readConcern docs #106 [Fonger](https://github.com/Fonger)
|
||||
|
||||
3.1.0 / 2018-07-29
|
||||
==================
|
||||
* feat: add `readConcern()` helper #105 [Fonger](https://github.com/Fonger)
|
||||
* feat: add `maxTimeMS()` as alias of `maxTime()` #105 [Fonger](https://github.com/Fonger)
|
||||
* feat: add `collation()` helper #105 [Fonger](https://github.com/Fonger)
|
||||
|
||||
3.0.1 / 2018-07-02
|
||||
==================
|
||||
* fix: parse sort array options correctly #103 #102 [Fonger](https://github.com/Fonger)
|
||||
|
||||
3.0.0 / 2018-01-20
|
||||
==================
|
||||
* chore: upgrade deps and add nsp
|
||||
|
||||
3.0.0-rc0 / 2017-12-06
|
||||
======================
|
||||
* BREAKING CHANGE: remove support for node < 4
|
||||
* BREAKING CHANGE: remove support for retainKeyOrder, will always be true by default re: Automattic/mongoose#2749
|
||||
|
||||
2.3.3 / 2017-11-19
|
||||
==================
|
||||
* fixed; catch sync errors in cursor.toArray() re: Automattic/mongoose#5812
|
||||
|
||||
2.3.2 / 2017-09-27
|
||||
==================
|
||||
* fixed; bumped debug -> 2.6.9 re: #89
|
||||
|
||||
2.3.1 / 2017-05-22
|
||||
==================
|
||||
* fixed; bumped debug -> 2.6.7 re: #86
|
||||
|
||||
2.3.0 / 2017-03-05
|
||||
==================
|
||||
* added; replaceOne function
|
||||
* added; deleteOne and deleteMany functions
|
||||
|
||||
2.2.3 / 2017-01-31
|
||||
==================
|
||||
* fixed; throw correct error when passing incorrectly formatted array to sort()
|
||||
|
||||
2.2.2 / 2017-01-31
|
||||
==================
|
||||
* fixed; allow passing maps to sort()
|
||||
|
||||
2.2.1 / 2017-01-29
|
||||
==================
|
||||
* fixed; allow passing string to hint()
|
||||
|
||||
2.2.0 / 2017-01-08
|
||||
==================
|
||||
* added; updateOne and updateMany functions
|
||||
|
||||
2.1.0 / 2016-12-22
|
||||
==================
|
||||
* added; ability to pass an array to select() #81 [dciccale](https://github.com/dciccale)
|
||||
|
||||
2.0.0 / 2016-09-25
|
||||
==================
|
||||
* added; support for mongodb driver 2.0 streams
|
||||
|
||||
1.12.0 / 2016-09-25
|
||||
===================
|
||||
* added; `retainKeyOrder` option re: Automattic/mongoose#4542
|
||||
|
||||
1.11.0 / 2016-06-04
|
||||
===================
|
||||
* added; `.minDistance()` helper and minDistance for `.near()` Automattic/mongoose#4179
|
||||
|
||||
1.10.1 / 2016-04-26
|
||||
===================
|
||||
* fixed; ensure conditions is an object before assigning #75
|
||||
|
||||
1.10.0 / 2016-03-16
|
||||
==================
|
||||
|
||||
* updated; bluebird to latest 2.10.2 version #74 [matskiv](https://github.com/matskiv)
|
||||
|
||||
1.9.0 / 2016-03-15
|
||||
==================
|
||||
* added; `.eq` as a shortcut for `.equals` #72 [Fonger](https://github.com/Fonger)
|
||||
* added; ability to use array syntax for sort re: https://jira.mongodb.org/browse/NODE-578 #67
|
||||
|
||||
1.8.0 / 2016-03-01
|
||||
==================
|
||||
* fixed; dont throw an error if count used with sort or select Automattic/mongoose#3914
|
||||
|
||||
1.7.0 / 2016-02-23
|
||||
==================
|
||||
* fixed; don't treat objects with a length property as argument objects #70
|
||||
* added; `.findCursor()` method #69 [nswbmw](https://github.com/nswbmw)
|
||||
* added; `_compiledUpdate` property #68 [nswbmw](https://github.com/nswbmw)
|
||||
|
||||
1.6.2 / 2015-07-12
|
||||
==================
|
||||
|
||||
* fixed; support exec cb being called synchronously #66
|
||||
|
||||
1.6.1 / 2015-06-16
|
||||
==================
|
||||
|
||||
* fixed; do not treat $meta projection as inclusive [vkarpov15](https://github.com/vkarpov15)
|
||||
|
||||
1.6.0 / 2015-05-27
|
||||
==================
|
||||
|
||||
* update dependencies #65 [bachp](https://github.com/bachp)
|
||||
|
||||
1.5.0 / 2015-03-31
|
||||
==================
|
||||
|
||||
* fixed; debug output
|
||||
* fixed; allow hint usage with count #61 [trueinsider](https://github.com/trueinsider)
|
||||
|
||||
1.4.0 / 2015-03-29
|
||||
==================
|
||||
|
||||
* added; object support to slice() #60 [vkarpov15](https://github.com/vkarpov15)
|
||||
* debug; improved output #57 [flyvictor](https://github.com/flyvictor)
|
||||
|
||||
1.3.0 / 2014-11-06
|
||||
==================
|
||||
|
||||
* added; setTraceFunction() #53 from [jlai](https://github.com/jlai)
|
||||
|
||||
1.2.1 / 2014-09-26
|
||||
==================
|
||||
|
||||
* fixed; distinct assignment in toConstructor() #51 from [esco](https://github.com/esco)
|
||||
|
||||
1.2.0 / 2014-09-18
|
||||
==================
|
||||
|
||||
* added; stream() support for find()
|
||||
|
||||
1.1.0 / 2014-09-15
|
||||
==================
|
||||
|
||||
* add #then for co / koa support
|
||||
* start checking code coverage
|
||||
|
||||
1.0.0 / 2014-07-07
|
||||
==================
|
||||
|
||||
* Remove broken require() calls until they're actually implemented #48 [vkarpov15](https://github.com/vkarpov15)
|
||||
|
||||
0.9.0 / 2014-05-22
|
||||
==================
|
||||
|
||||
* added; thunk() support
|
||||
* release 0.8.0
|
||||
|
||||
0.8.0 / 2014-05-15
|
||||
==================
|
||||
|
||||
* added; support for maxTimeMS #44 [yoitsro](https://github.com/yoitsro)
|
||||
* updated; devDependency (driver to 1.4.4)
|
||||
|
||||
0.7.0 / 2014-05-02
|
||||
==================
|
||||
|
||||
* fixed; pass $maxDistance in $near object as described in docs #43 [vkarpov15](https://github.com/vkarpov15)
|
||||
* fixed; cloning buffers #42 [gjohnson](https://github.com/gjohnson)
|
||||
* tests; a little bit more `mongodb` agnostic #34 [refack](https://github.com/refack)
|
||||
|
||||
0.6.0 / 2014-04-01
|
||||
==================
|
||||
|
||||
* fixed; Allow $meta args in sort() so text search sorting works #37 [vkarpov15](https://github.com/vkarpov15)
|
||||
|
||||
0.5.3 / 2014-02-22
|
||||
==================
|
||||
|
||||
* fixed; cloning mongodb.Binary
|
||||
|
||||
0.5.2 / 2014-01-30
|
||||
==================
|
||||
|
||||
* fixed; cloning ObjectId constructors
|
||||
* fixed; cloning of ReadPreferences #30 [ashtuchkin](https://github.com/ashtuchkin)
|
||||
* tests; use specific mongodb version #29 [AvianFlu](https://github.com/AvianFlu)
|
||||
* tests; remove dependency on ObjectId #28 [refack](https://github.com/refack)
|
||||
* tests; add failing ReadPref test
|
||||
|
||||
0.5.1 / 2014-01-17
|
||||
==================
|
||||
|
||||
* added; deprecation notice to tags parameter #27 [ashtuchkin](https://github.com/ashtuchkin)
|
||||
* readme; add links
|
||||
|
||||
0.5.0 / 2014-01-16
|
||||
==================
|
||||
|
||||
* removed; mongodb driver dependency #26 [ashtuchkin](https://github.com/ashtuchkin)
|
||||
* removed; first class support of read preference tags #26 (still supported though) [ashtuchkin](https://github.com/ashtuchkin)
|
||||
* added; better ObjectId clone support
|
||||
* fixed; cloning objects that have no constructor #21
|
||||
* docs; cleaned up [ashtuchkin](https://github.com/ashtuchkin)
|
||||
|
||||
0.4.2 / 2014-01-08
|
||||
==================
|
||||
|
||||
* updated; debug module 0.7.4 [refack](https://github.com/refack)
|
||||
|
||||
0.4.1 / 2014-01-07
|
||||
==================
|
||||
|
||||
* fixed; inclusive/exclusive logic
|
||||
|
||||
0.4.0 / 2014-01-06
|
||||
==================
|
||||
|
||||
* added; selected()
|
||||
* added; selectedInclusively()
|
||||
* added; selectedExclusively()
|
||||
|
||||
0.3.3 / 2013-11-14
|
||||
==================
|
||||
|
||||
* Fix Mongo DB Dependency #20 [rschmukler](https://github.com/rschmukler)
|
||||
|
||||
0.3.2 / 2013-09-06
|
||||
==================
|
||||
|
||||
* added; geometry support for near()
|
||||
|
||||
0.3.1 / 2013-08-22
|
||||
==================
|
||||
|
||||
* fixed; update retains key order #19
|
||||
|
||||
0.3.0 / 2013-08-22
|
||||
==================
|
||||
|
||||
* less hardcoded isNode env detection #18 [vshulyak](https://github.com/vshulyak)
|
||||
* added; validation of findAndModify varients
|
||||
* clone update doc before execution
|
||||
* stricter env checks
|
||||
|
||||
0.2.7 / 2013-08-2
|
||||
==================
|
||||
|
||||
* Now support GeoJSON point values for Query#near
|
||||
|
||||
0.2.6 / 2013-07-30
|
||||
==================
|
||||
|
||||
* internally, 'asc' and 'desc' for sorts are now converted into 1 and -1, respectively
|
||||
|
||||
0.2.5 / 2013-07-30
|
||||
==================
|
||||
|
||||
* updated docs
|
||||
* changed internal representation of `sort` to use objects instead of arrays
|
||||
|
||||
0.2.4 / 2013-07-25
|
||||
==================
|
||||
|
||||
* updated; sliced to 0.0.5
|
||||
|
||||
0.2.3 / 2013-07-09
|
||||
==================
|
||||
|
||||
* now using a callback in collection.find instead of directly calling toArray() on the cursor [ebensing](https://github.com/ebensing)
|
||||
|
||||
0.2.2 / 2013-07-09
|
||||
==================
|
||||
|
||||
* now exposing mongodb export to allow for better testing [ebensing](https://github.com/ebensing)
|
||||
|
||||
0.2.1 / 2013-07-08
|
||||
==================
|
||||
|
||||
* select no longer accepts arrays as parameters [ebensing](https://github.com/ebensing)
|
||||
|
||||
0.2.0 / 2013-07-05
|
||||
==================
|
||||
|
||||
* use $geoWithin by default
|
||||
|
||||
0.1.2 / 2013-07-02
|
||||
==================
|
||||
|
||||
* added use$geoWithin flag [ebensing](https://github.com/ebensing)
|
||||
* fix read preferences typo [ebensing](https://github.com/ebensing)
|
||||
* fix reference to old param name in exists() [ebensing](https://github.com/ebensing)
|
||||
|
||||
0.1.1 / 2013-06-24
|
||||
==================
|
||||
|
||||
* fixed; $intersects -> $geoIntersects #14 [ebensing](https://github.com/ebensing)
|
||||
* fixed; Retain key order when copying objects #15 [ebensing](https://github.com/ebensing)
|
||||
* bump mongodb dev dep
|
||||
|
||||
0.1.0 / 2013-05-06
|
||||
==================
|
||||
|
||||
* findAndModify; return the query
|
||||
* move mquery.proto.canMerge to mquery.canMerge
|
||||
* overwrite option now works with non-empty objects
|
||||
* use strict mode
|
||||
* validate count options
|
||||
* validate distinct options
|
||||
* add aggregate to base collection methods
|
||||
* clone merge arguments
|
||||
* clone merged update arguments
|
||||
* move subclass to mquery.prototype.toConstructor
|
||||
* fixed; maxScan casing
|
||||
* use regexp-clone
|
||||
* added; geometry/intersects support
|
||||
* support $and
|
||||
* near: do not use "radius"
|
||||
* callbacks always fire on next turn of loop
|
||||
* defined collection interface
|
||||
* remove time from tests
|
||||
* clarify goals
|
||||
* updated docs;
|
||||
|
||||
0.0.1 / 2012-12-15
|
||||
==================
|
||||
|
||||
* initial release
|
||||
22
parts/3/phonebookBackend/node_modules/mquery/LICENSE
generated
vendored
Normal file
22
parts/3/phonebookBackend/node_modules/mquery/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
1247
parts/3/phonebookBackend/node_modules/mquery/README.md
generated
vendored
Normal file
1247
parts/3/phonebookBackend/node_modules/mquery/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
parts/3/phonebookBackend/node_modules/mquery/SECURITY.md
generated
vendored
Normal file
1
parts/3/phonebookBackend/node_modules/mquery/SECURITY.md
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
Please follow the instructions on [Tidelift's security page](https://tidelift.com/docs/security) to report a security issue.
|
||||
45
parts/3/phonebookBackend/node_modules/mquery/lib/collection/collection.js
generated
vendored
Normal file
45
parts/3/phonebookBackend/node_modules/mquery/lib/collection/collection.js
generated
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* methods a collection must implement
|
||||
*/
|
||||
|
||||
const methods = [
|
||||
'find',
|
||||
'findOne',
|
||||
'updateMany',
|
||||
'updateOne',
|
||||
'replaceOne',
|
||||
'count',
|
||||
'distinct',
|
||||
'findOneAndDelete',
|
||||
'findOneAndUpdate',
|
||||
'aggregate',
|
||||
'findCursor',
|
||||
'deleteOne',
|
||||
'deleteMany'
|
||||
];
|
||||
|
||||
/**
|
||||
* Collection base class from which implementations inherit
|
||||
*/
|
||||
|
||||
function Collection() {}
|
||||
|
||||
for (let i = 0, len = methods.length; i < len; ++i) {
|
||||
const method = methods[i];
|
||||
Collection.prototype[method] = notImplemented(method);
|
||||
}
|
||||
|
||||
module.exports = exports = Collection;
|
||||
Collection.methods = methods;
|
||||
|
||||
/**
|
||||
* creates a function which throws an implementation error
|
||||
*/
|
||||
|
||||
function notImplemented(method) {
|
||||
return function() {
|
||||
throw new Error('collection.' + method + ' not implemented');
|
||||
};
|
||||
}
|
||||
13
parts/3/phonebookBackend/node_modules/mquery/lib/collection/index.js
generated
vendored
Normal file
13
parts/3/phonebookBackend/node_modules/mquery/lib/collection/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
const env = require('../env');
|
||||
|
||||
if ('unknown' == env.type) {
|
||||
throw new Error('Unknown environment');
|
||||
}
|
||||
|
||||
module.exports =
|
||||
env.isNode ? require('./node') :
|
||||
env.isMongo ? require('./collection') :
|
||||
require('./collection');
|
||||
|
||||
114
parts/3/phonebookBackend/node_modules/mquery/lib/collection/node.js
generated
vendored
Normal file
114
parts/3/phonebookBackend/node_modules/mquery/lib/collection/node.js
generated
vendored
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
const Collection = require('./collection');
|
||||
|
||||
class NodeCollection extends Collection {
|
||||
constructor(col) {
|
||||
super();
|
||||
|
||||
this.collection = col;
|
||||
this.collectionName = col.collectionName;
|
||||
}
|
||||
|
||||
/**
|
||||
* find(match, options)
|
||||
*/
|
||||
async find(match, options) {
|
||||
const cursor = this.collection.find(match, options);
|
||||
|
||||
return cursor.toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* findOne(match, options)
|
||||
*/
|
||||
async findOne(match, options) {
|
||||
return this.collection.findOne(match, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* count(match, options)
|
||||
*/
|
||||
async count(match, options) {
|
||||
return this.collection.count(match, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* distinct(prop, match, options)
|
||||
*/
|
||||
async distinct(prop, match, options) {
|
||||
return this.collection.distinct(prop, match, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* updateMany(match, update, options)
|
||||
*/
|
||||
async updateMany(match, update, options) {
|
||||
return this.collection.updateMany(match, update, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* updateOne(match, update, options)
|
||||
*/
|
||||
async updateOne(match, update, options) {
|
||||
return this.collection.updateOne(match, update, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* replaceOne(match, update, options)
|
||||
*/
|
||||
async replaceOne(match, update, options) {
|
||||
return this.collection.replaceOne(match, update, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* deleteOne(match, options)
|
||||
*/
|
||||
async deleteOne(match, options) {
|
||||
return this.collection.deleteOne(match, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* deleteMany(match, options)
|
||||
*/
|
||||
async deleteMany(match, options) {
|
||||
return this.collection.deleteMany(match, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* findOneAndDelete(match, options, function(err[, result])
|
||||
*/
|
||||
async findOneAndDelete(match, options) {
|
||||
return this.collection.findOneAndDelete(match, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* findOneAndUpdate(match, update, options)
|
||||
*/
|
||||
async findOneAndUpdate(match, update, options) {
|
||||
return this.collection.findOneAndUpdate(match, update, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* var cursor = findCursor(match, options)
|
||||
*/
|
||||
findCursor(match, options) {
|
||||
return this.collection.find(match, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* aggregation(operators...)
|
||||
* TODO
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Expose
|
||||
*/
|
||||
|
||||
module.exports = exports = NodeCollection;
|
||||
22
parts/3/phonebookBackend/node_modules/mquery/lib/env.js
generated
vendored
Normal file
22
parts/3/phonebookBackend/node_modules/mquery/lib/env.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
exports.isNode = 'undefined' != typeof process
|
||||
&& 'object' == typeof module
|
||||
&& 'object' == typeof global
|
||||
&& 'function' == typeof Buffer
|
||||
&& process.argv;
|
||||
|
||||
exports.isMongo = !exports.isNode
|
||||
&& 'function' == typeof printjson
|
||||
&& 'function' == typeof ObjectId
|
||||
&& 'function' == typeof rs
|
||||
&& 'function' == typeof sh;
|
||||
|
||||
exports.isBrowser = !exports.isNode
|
||||
&& !exports.isMongo
|
||||
&& 'undefined' != typeof window;
|
||||
|
||||
exports.type = exports.isNode ? 'node'
|
||||
: exports.isMongo ? 'mongo'
|
||||
: exports.isBrowser ? 'browser'
|
||||
: 'unknown';
|
||||
2705
parts/3/phonebookBackend/node_modules/mquery/lib/mquery.js
generated
vendored
Normal file
2705
parts/3/phonebookBackend/node_modules/mquery/lib/mquery.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
78
parts/3/phonebookBackend/node_modules/mquery/lib/permissions.js
generated
vendored
Normal file
78
parts/3/phonebookBackend/node_modules/mquery/lib/permissions.js
generated
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
'use strict';
|
||||
|
||||
const denied = exports;
|
||||
|
||||
denied.distinct = function(self) {
|
||||
if (self._fields && Object.keys(self._fields).length > 0) {
|
||||
return 'field selection and slice';
|
||||
}
|
||||
|
||||
const keys = Object.keys(denied.distinct);
|
||||
let err;
|
||||
|
||||
keys.every(function(option) {
|
||||
if (self.options[option]) {
|
||||
err = option;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
return err;
|
||||
};
|
||||
denied.distinct.select =
|
||||
denied.distinct.slice =
|
||||
denied.distinct.sort =
|
||||
denied.distinct.limit =
|
||||
denied.distinct.skip =
|
||||
denied.distinct.batchSize =
|
||||
denied.distinct.hint =
|
||||
denied.distinct.tailable = true;
|
||||
|
||||
|
||||
// aggregation integration
|
||||
|
||||
|
||||
denied.findOneAndUpdate =
|
||||
denied.findOneAndRemove = function(self) {
|
||||
const keys = Object.keys(denied.findOneAndUpdate);
|
||||
let err;
|
||||
|
||||
keys.every(function(option) {
|
||||
if (self.options[option]) {
|
||||
err = option;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
return err;
|
||||
};
|
||||
denied.findOneAndUpdate.limit =
|
||||
denied.findOneAndUpdate.skip =
|
||||
denied.findOneAndUpdate.batchSize =
|
||||
denied.findOneAndUpdate.tailable = true;
|
||||
|
||||
|
||||
denied.count = function(self) {
|
||||
if (self._fields && Object.keys(self._fields).length > 0) {
|
||||
return 'field selection and slice';
|
||||
}
|
||||
|
||||
const keys = Object.keys(denied.count);
|
||||
let err;
|
||||
|
||||
keys.every(function(option) {
|
||||
if (self.options[option]) {
|
||||
err = option;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
return err;
|
||||
};
|
||||
|
||||
denied.count.slice =
|
||||
denied.count.batchSize =
|
||||
denied.count.tailable = true;
|
||||
297
parts/3/phonebookBackend/node_modules/mquery/lib/utils.js
generated
vendored
Normal file
297
parts/3/phonebookBackend/node_modules/mquery/lib/utils.js
generated
vendored
Normal file
|
|
@ -0,0 +1,297 @@
|
|||
'use strict';
|
||||
|
||||
/*!
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
const specialProperties = ['__proto__', 'constructor', 'prototype'];
|
||||
|
||||
/**
|
||||
* Clones objects
|
||||
*
|
||||
* @param {Object} obj the object to clone
|
||||
* @param {Object} options
|
||||
* @return {Object} the cloned object
|
||||
* @api private
|
||||
*/
|
||||
|
||||
const clone = exports.clone = function clone(obj, options) {
|
||||
if (obj === undefined || obj === null)
|
||||
return obj;
|
||||
|
||||
if (Array.isArray(obj))
|
||||
return exports.cloneArray(obj, options);
|
||||
|
||||
if (obj.constructor) {
|
||||
if (/ObjectI[dD]$/.test(obj.constructor.name)) {
|
||||
return 'function' == typeof obj.clone
|
||||
? obj.clone()
|
||||
: new obj.constructor(obj.id);
|
||||
}
|
||||
|
||||
if (obj.constructor.name === 'ReadPreference') {
|
||||
return new obj.constructor(obj.mode, clone(obj.tags, options));
|
||||
}
|
||||
|
||||
if ('Binary' == obj._bsontype && obj.buffer && obj.value) {
|
||||
return 'function' == typeof obj.clone
|
||||
? obj.clone()
|
||||
: new obj.constructor(obj.value(true), obj.sub_type);
|
||||
}
|
||||
|
||||
if ('Date' === obj.constructor.name || 'Function' === obj.constructor.name)
|
||||
return new obj.constructor(+obj);
|
||||
|
||||
if ('RegExp' === obj.constructor.name)
|
||||
return new RegExp(obj);
|
||||
|
||||
if ('Buffer' === obj.constructor.name)
|
||||
return Buffer.from(obj);
|
||||
}
|
||||
|
||||
if (isObject(obj))
|
||||
return exports.cloneObject(obj, options);
|
||||
|
||||
if (obj.valueOf)
|
||||
return obj.valueOf();
|
||||
};
|
||||
|
||||
/*!
|
||||
* ignore
|
||||
*/
|
||||
|
||||
exports.cloneObject = function cloneObject(obj, options) {
|
||||
const minimize = options && options.minimize,
|
||||
ret = {},
|
||||
keys = Object.keys(obj),
|
||||
len = keys.length;
|
||||
let hasKeys = false,
|
||||
val,
|
||||
k = '',
|
||||
i = 0;
|
||||
|
||||
for (i = 0; i < len; ++i) {
|
||||
k = keys[i];
|
||||
// Not technically prototype pollution because this wouldn't merge properties
|
||||
// onto `Object.prototype`, but avoid properties like __proto__ as a precaution.
|
||||
if (specialProperties.indexOf(k) !== -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
val = clone(obj[k], options);
|
||||
|
||||
if (!minimize || ('undefined' !== typeof val)) {
|
||||
hasKeys || (hasKeys = true);
|
||||
ret[k] = val;
|
||||
}
|
||||
}
|
||||
|
||||
return minimize
|
||||
? hasKeys && ret
|
||||
: ret;
|
||||
};
|
||||
|
||||
exports.cloneArray = function cloneArray(arr, options) {
|
||||
const ret = [],
|
||||
l = arr.length;
|
||||
let i = 0;
|
||||
for (; i < l; i++)
|
||||
ret.push(clone(arr[i], options));
|
||||
return ret;
|
||||
};
|
||||
|
||||
/**
|
||||
* Merges `from` into `to` without overwriting existing properties.
|
||||
*
|
||||
* @param {Object} to
|
||||
* @param {Object} from
|
||||
* @api private
|
||||
*/
|
||||
|
||||
exports.merge = function merge(to, from) {
|
||||
const keys = Object.keys(from);
|
||||
|
||||
for (const key of keys) {
|
||||
if (specialProperties.indexOf(key) !== -1) {
|
||||
continue;
|
||||
}
|
||||
if ('undefined' === typeof to[key]) {
|
||||
to[key] = from[key];
|
||||
} else {
|
||||
if (exports.isObject(from[key])) {
|
||||
merge(to[key], from[key]);
|
||||
} else {
|
||||
to[key] = from[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Same as merge but clones the assigned values.
|
||||
*
|
||||
* @param {Object} to
|
||||
* @param {Object} from
|
||||
* @api private
|
||||
*/
|
||||
|
||||
exports.mergeClone = function mergeClone(to, from) {
|
||||
const keys = Object.keys(from);
|
||||
|
||||
for (const key of keys) {
|
||||
if (specialProperties.indexOf(key) !== -1) {
|
||||
continue;
|
||||
}
|
||||
if ('undefined' === typeof to[key]) {
|
||||
to[key] = clone(from[key]);
|
||||
} else {
|
||||
if (exports.isObject(from[key])) {
|
||||
mergeClone(to[key], from[key]);
|
||||
} else {
|
||||
to[key] = clone(from[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Read pref helper (mongo 2.2 drivers support this)
|
||||
*
|
||||
* Allows using aliases instead of full preference names:
|
||||
*
|
||||
* p primary
|
||||
* pp primaryPreferred
|
||||
* s secondary
|
||||
* sp secondaryPreferred
|
||||
* n nearest
|
||||
*
|
||||
* @param {String} pref
|
||||
*/
|
||||
|
||||
exports.readPref = function readPref(pref) {
|
||||
switch (pref) {
|
||||
case 'p':
|
||||
pref = 'primary';
|
||||
break;
|
||||
case 'pp':
|
||||
pref = 'primaryPreferred';
|
||||
break;
|
||||
case 's':
|
||||
pref = 'secondary';
|
||||
break;
|
||||
case 'sp':
|
||||
pref = 'secondaryPreferred';
|
||||
break;
|
||||
case 'n':
|
||||
pref = 'nearest';
|
||||
break;
|
||||
}
|
||||
|
||||
return pref;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Read Concern helper (mongo 3.2 drivers support this)
|
||||
*
|
||||
* Allows using string to specify read concern level:
|
||||
*
|
||||
* local 3.2+
|
||||
* available 3.6+
|
||||
* majority 3.2+
|
||||
* linearizable 3.4+
|
||||
* snapshot 4.0+
|
||||
*
|
||||
* @param {String|Object} concern
|
||||
*/
|
||||
|
||||
exports.readConcern = function readConcern(concern) {
|
||||
if ('string' === typeof concern) {
|
||||
switch (concern) {
|
||||
case 'l':
|
||||
concern = 'local';
|
||||
break;
|
||||
case 'a':
|
||||
concern = 'available';
|
||||
break;
|
||||
case 'm':
|
||||
concern = 'majority';
|
||||
break;
|
||||
case 'lz':
|
||||
concern = 'linearizable';
|
||||
break;
|
||||
case 's':
|
||||
concern = 'snapshot';
|
||||
break;
|
||||
}
|
||||
concern = { level: concern };
|
||||
}
|
||||
return concern;
|
||||
};
|
||||
|
||||
/**
|
||||
* Object.prototype.toString.call helper
|
||||
*/
|
||||
|
||||
const _toString = Object.prototype.toString;
|
||||
exports.toString = function(arg) {
|
||||
return _toString.call(arg);
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines if `arg` is an object.
|
||||
*
|
||||
* @param {Object|Array|String|Function|RegExp|any} arg
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
const isObject = exports.isObject = function(arg) {
|
||||
return '[object Object]' == exports.toString(arg);
|
||||
};
|
||||
|
||||
/**
|
||||
* Object.keys helper
|
||||
*/
|
||||
|
||||
exports.keys = Object.keys;
|
||||
|
||||
/**
|
||||
* Basic Object.create polyfill.
|
||||
* Only one argument is supported.
|
||||
*
|
||||
* Based on https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create
|
||||
*/
|
||||
|
||||
exports.create = 'function' == typeof Object.create
|
||||
? Object.create
|
||||
: create;
|
||||
|
||||
function create(proto) {
|
||||
if (arguments.length > 1) {
|
||||
throw new Error('Adding properties is not supported');
|
||||
}
|
||||
|
||||
function F() { }
|
||||
F.prototype = proto;
|
||||
return new F;
|
||||
}
|
||||
|
||||
/**
|
||||
* inheritance
|
||||
*/
|
||||
|
||||
exports.inherits = function(ctor, superCtor) {
|
||||
ctor.prototype = exports.create(superCtor.prototype);
|
||||
ctor.prototype.constructor = ctor;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if this object is an arguments object
|
||||
*
|
||||
* @param {Any} v
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
exports.isArgumentsObject = function(v) {
|
||||
return Object.prototype.toString.call(v) === '[object Arguments]';
|
||||
};
|
||||
38
parts/3/phonebookBackend/node_modules/mquery/package.json
generated
vendored
Normal file
38
parts/3/phonebookBackend/node_modules/mquery/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "mquery",
|
||||
"version": "5.0.0",
|
||||
"description": "Expressive query building for MongoDB",
|
||||
"main": "lib/mquery.js",
|
||||
"scripts": {
|
||||
"test": "mocha --exit test/index.js test/*.test.js",
|
||||
"fix-lint": "eslint . --fix",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/aheckmann/mquery.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "4.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "8.x",
|
||||
"eslint-plugin-mocha-no-only": "1.1.1",
|
||||
"mocha": "9.x",
|
||||
"mongodb": "5.x"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/aheckmann/mquery/issues/new"
|
||||
},
|
||||
"author": "Aaron Heckmann <aaron.heckmann+github@gmail.com>",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"mongodb",
|
||||
"query",
|
||||
"builder"
|
||||
],
|
||||
"homepage": "https://github.com/aheckmann/mquery/"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue