├── .gitignore ├── lib ├── docoomentdb │ ├── node_modules │ │ ├── mongodb │ │ │ ├── .gitmodules │ │ │ ├── node_modules │ │ │ │ ├── bson │ │ │ │ │ ├── builderror.log │ │ │ │ │ ├── build │ │ │ │ │ │ ├── Release │ │ │ │ │ │ │ ├── linker.lock │ │ │ │ │ │ │ ├── .deps │ │ │ │ │ │ │ │ └── Release │ │ │ │ │ │ │ │ │ ├── bson.node.d │ │ │ │ │ │ │ │ │ └── obj.target │ │ │ │ │ │ │ │ │ ├── bson.node.d │ │ │ │ │ │ │ │ │ └── bson │ │ │ │ │ │ │ │ │ └── ext │ │ │ │ │ │ │ │ │ └── bson.o.d │ │ │ │ │ │ │ ├── bson.node │ │ │ │ │ │ │ └── obj.target │ │ │ │ │ │ │ │ ├── bson.node │ │ │ │ │ │ │ │ └── bson │ │ │ │ │ │ │ │ └── ext │ │ │ │ │ │ │ │ └── bson.o │ │ │ │ │ │ └── binding.Makefile │ │ │ │ │ ├── node_modules │ │ │ │ │ │ └── nan │ │ │ │ │ │ │ ├── include_dirs.js │ │ │ │ │ │ │ ├── .dntrc │ │ │ │ │ │ │ └── appveyor.yml │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── ext │ │ │ │ │ │ ├── win32 │ │ │ │ │ │ │ ├── ia32 │ │ │ │ │ │ │ │ └── bson.node │ │ │ │ │ │ │ └── x64 │ │ │ │ │ │ │ │ └── bson.node │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── wscript │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── build_browser.js │ │ │ │ │ ├── tools │ │ │ │ │ │ ├── jasmine-1.1.0 │ │ │ │ │ │ │ ├── jasmine_favicon.png │ │ │ │ │ │ │ └── MIT.LICENSE │ │ │ │ │ │ └── gleak.js │ │ │ │ │ ├── lib │ │ │ │ │ │ └── bson │ │ │ │ │ │ │ ├── min_key.js │ │ │ │ │ │ │ ├── max_key.js │ │ │ │ │ │ │ ├── code.js │ │ │ │ │ │ │ ├── double.js │ │ │ │ │ │ │ ├── db_ref.js │ │ │ │ │ │ │ ├── symbol.js │ │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── browser_build │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── binding.gyp │ │ │ │ │ └── package.json │ │ │ │ ├── kerberos │ │ │ │ │ ├── builderror.log │ │ │ │ │ ├── build │ │ │ │ │ │ ├── Release │ │ │ │ │ │ │ ├── linker.lock │ │ │ │ │ │ │ ├── kerberos.node │ │ │ │ │ │ │ ├── .deps │ │ │ │ │ │ │ │ └── Release │ │ │ │ │ │ │ │ │ ├── kerberos.node.d │ │ │ │ │ │ │ │ │ └── obj.target │ │ │ │ │ │ │ │ │ └── kerberos.node.d │ │ │ │ │ │ │ └── obj.target │ │ │ │ │ │ │ │ └── kerberos.node │ │ │ │ │ │ ├── binding.Makefile │ │ │ │ │ │ └── kerberos.target.mk │ │ │ │ │ ├── README.md │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── worker.cc │ │ │ │ │ │ ├── win32 │ │ │ │ │ │ │ ├── worker.cc │ │ │ │ │ │ │ ├── wrappers │ │ │ │ │ │ │ │ ├── security_context.js │ │ │ │ │ │ │ │ ├── security_buffer_descriptor.js │ │ │ │ │ │ │ │ ├── security_buffer.js │ │ │ │ │ │ │ │ ├── security_credentials.js │ │ │ │ │ │ │ │ ├── security_buffer_descriptor.h │ │ │ │ │ │ │ │ ├── security_buffer.h │ │ │ │ │ │ │ │ └── security_credentials.h │ │ │ │ │ │ │ ├── base64.h │ │ │ │ │ │ │ ├── worker.h │ │ │ │ │ │ │ ├── kerberos.h │ │ │ │ │ │ │ └── kerberos.cc │ │ │ │ │ │ ├── sspi.js │ │ │ │ │ │ ├── base64.h │ │ │ │ │ │ ├── worker.h │ │ │ │ │ │ ├── kerberos_context.h │ │ │ │ │ │ └── kerberos.h │ │ │ │ │ ├── index.js │ │ │ │ │ ├── test │ │ │ │ │ │ ├── win32 │ │ │ │ │ │ │ ├── security_buffer_tests.js │ │ │ │ │ │ │ ├── security_buffer_descriptor_tests.js │ │ │ │ │ │ │ └── security_credentials_tests.js │ │ │ │ │ │ ├── kerberos_win32_test.js │ │ │ │ │ │ └── kerberos_tests.js │ │ │ │ │ ├── binding.gyp │ │ │ │ │ └── package.json │ │ │ │ └── readable-stream │ │ │ │ │ ├── node_modules │ │ │ │ │ ├── string_decoder │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── inherits │ │ │ │ │ │ ├── inherits.js │ │ │ │ │ │ ├── test.js │ │ │ │ │ │ ├── inherits_browser.js │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── core-util-is │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ └── package.json │ │ │ │ │ └── isarray │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ └── README.md │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── duplex.js │ │ │ │ │ ├── transform.js │ │ │ │ │ ├── writable.js │ │ │ │ │ ├── passthrough.js │ │ │ │ │ ├── readable.js │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── lib │ │ │ │ │ └── _stream_passthrough.js │ │ │ │ │ └── package.json │ │ │ ├── index.js │ │ │ ├── .travis.yml │ │ │ ├── Makefile │ │ │ ├── lib │ │ │ │ └── mongodb │ │ │ │ │ ├── commands │ │ │ │ │ └── base_command.js │ │ │ │ │ ├── connection │ │ │ │ │ ├── connection_utils.js │ │ │ │ │ ├── server_capabilities.js │ │ │ │ │ └── repl_set │ │ │ │ │ │ └── repl_set_state.js │ │ │ │ │ └── index.js │ │ │ └── CONTRIBUTING.md │ │ ├── mpromise │ │ │ ├── .idea │ │ │ │ ├── .name │ │ │ │ ├── scopes │ │ │ │ │ └── scope_settings.xml │ │ │ │ ├── encodings.xml │ │ │ │ ├── other.xml │ │ │ │ ├── vcs.xml │ │ │ │ ├── misc.xml │ │ │ │ ├── inspectionProfiles │ │ │ │ │ ├── profiles_settings.xml │ │ │ │ │ └── Project_Default.xml │ │ │ │ ├── modules.xml │ │ │ │ ├── jsLibraryMappings.xml │ │ │ │ ├── libraries │ │ │ │ │ └── Node_js_Dependencies_for_mpromise.xml │ │ │ │ ├── mpromise.iml │ │ │ │ └── codeStyleSettings.xml │ │ │ ├── .npmignore │ │ │ ├── index.js │ │ │ ├── .travis.yml │ │ │ ├── test │ │ │ │ ├── promise.domain.test.js │ │ │ │ └── promises.Aplus.js │ │ │ ├── LICENSE │ │ │ └── History.md │ │ ├── mquery │ │ │ ├── test │ │ │ │ ├── collection │ │ │ │ │ ├── browser.js │ │ │ │ │ ├── mongo.js │ │ │ │ │ └── node.js │ │ │ │ ├── utils.js │ │ │ │ └── env.js │ │ │ ├── .npmignore │ │ │ ├── Makefile │ │ │ ├── .travis.yml │ │ │ ├── node_modules │ │ │ │ └── debug │ │ │ │ │ └── index.js │ │ │ ├── lib │ │ │ │ ├── collection │ │ │ │ │ ├── index.js │ │ │ │ │ └── collection.js │ │ │ │ ├── env.js │ │ │ │ └── permissions.js │ │ │ └── LICENSE │ │ ├── ms │ │ │ ├── .npmignore │ │ │ ├── Makefile │ │ │ ├── test │ │ │ │ ├── index.html │ │ │ │ └── test.js │ │ │ ├── ms.js │ │ │ └── README.md │ │ ├── hooks │ │ │ ├── .npmignore │ │ │ └── Makefile │ │ ├── mpath │ │ │ ├── .npmignore │ │ │ ├── index.js │ │ │ ├── .travis.yml │ │ │ ├── Makefile │ │ │ ├── History.md │ │ │ └── LICENSE │ │ ├── muri │ │ │ ├── .npmignore │ │ │ ├── index.js │ │ │ ├── .travis.yml │ │ │ ├── Makefile │ │ │ ├── History.md │ │ │ ├── LICENSE │ │ │ └── README.md │ │ ├── sliced │ │ │ ├── .npmignore │ │ │ ├── index.js │ │ │ ├── .travis.yml │ │ │ ├── Makefile │ │ │ ├── component.json │ │ │ ├── lib │ │ │ │ └── sliced.js │ │ │ ├── History.md │ │ │ └── LICENSE │ │ └── regexp-clone │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── History.md │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── LICENSE │ │ │ └── package.json │ ├── lib │ │ ├── drivers │ │ │ ├── SPEC.md │ │ │ └── node-mongodb-native │ │ │ │ ├── binary.js │ │ │ │ └── objectid.js │ │ ├── types │ │ │ ├── index.js │ │ │ └── objectid.js │ │ ├── schema │ │ │ ├── index.js │ │ │ ├── mixed.js │ │ │ └── boolean.js │ │ ├── connectionstate.js │ │ ├── error │ │ │ ├── version.js │ │ │ ├── overwriteModel.js │ │ │ ├── missingSchema.js │ │ │ ├── cast.js │ │ │ ├── validator.js │ │ │ ├── validation.js │ │ │ ├── divergentArray.js │ │ │ └── messages.js │ │ ├── schemadefault.js │ │ ├── internal.js │ │ ├── error.js │ │ └── queryhelpers.js │ ├── examples │ │ ├── express │ │ │ ├── README.md │ │ │ └── connection-sharing │ │ │ │ ├── README.md │ │ │ │ ├── modelA.js │ │ │ │ ├── package.json │ │ │ │ ├── app.js │ │ │ │ └── routes.js │ │ ├── schema │ │ │ └── storing-schemas-as-json │ │ │ │ ├── schema.json │ │ │ │ └── index.js │ │ ├── lean │ │ │ ├── package.json │ │ │ ├── person.js │ │ │ └── lean.js │ │ ├── promises │ │ │ ├── package.json │ │ │ └── person.js │ │ ├── aggregate │ │ │ ├── package.json │ │ │ └── person.js │ │ ├── geospatial │ │ │ ├── package.json │ │ │ ├── geoJSONSchema.js │ │ │ ├── person.js │ │ │ └── geoJSONexample.js │ │ ├── mapreduce │ │ │ ├── package.json │ │ │ └── person.js │ │ ├── replicasets │ │ │ ├── package.json │ │ │ ├── person.js │ │ │ └── replica-sets.js │ │ ├── querybuilder │ │ │ ├── package.json │ │ │ ├── person.js │ │ │ └── querybuilder.js │ │ ├── globalschemas │ │ │ ├── person.js │ │ │ └── gs_example.js │ │ ├── statics │ │ │ ├── person.js │ │ │ └── statics.js │ │ ├── README.md │ │ ├── doc-methods.js │ │ └── population │ │ │ └── population-basic.js │ ├── index.js │ ├── README.md │ └── package.json ├── types │ ├── objectid.js │ └── index.js ├── connectionstate.js ├── schema │ ├── index.js │ ├── mixed.js │ └── boolean.js ├── error │ ├── version.js │ ├── overwriteModel.js │ ├── missingSchema.js │ ├── cast.js │ ├── validator.js │ ├── validation.js │ ├── divergentArray.js │ └── messages.js ├── internal.js ├── error.js └── queryhelpers.js ├── index.js ├── .travis.yml ├── test ├── test-query.js └── test.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | test/config.js 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/'); 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/.name: -------------------------------------------------------------------------------- 1 | mpromise -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/test/collection/browser.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/test/collection/mongo.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.11" 4 | - "0.10" -------------------------------------------------------------------------------- /lib/docoomentdb/lib/drivers/SPEC.md: -------------------------------------------------------------------------------- 1 | 2 | # Driver Spec 3 | 4 | TODO 5 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/hooks/.npmignore: -------------------------------------------------------------------------------- 1 | **.swp 2 | node_modules 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/builderror.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/builderror.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpath/.npmignore: -------------------------------------------------------------------------------- 1 | *.sw* 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/muri/.npmignore: -------------------------------------------------------------------------------- 1 | *.sw* 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/express/README.md: -------------------------------------------------------------------------------- 1 | Mongoose + Express examples 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/.npmignore: -------------------------------------------------------------------------------- 1 | *.sw* 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/sliced/.npmignore: -------------------------------------------------------------------------------- 1 | *.sw* 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/linker.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/regexp-clone/.npmignore: -------------------------------------------------------------------------------- 1 | *.sw* 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/Release/linker.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/mongodb'); 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpath/index.js: -------------------------------------------------------------------------------- 1 | module.exports = exports = require('./lib'); 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.npmignore: -------------------------------------------------------------------------------- 1 | *.sw* 2 | node_modules/ 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/muri/index.js: -------------------------------------------------------------------------------- 1 | module.exports = exports = require('./lib'); 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpath/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/index.js: -------------------------------------------------------------------------------- 1 | module.exports = exports = require('./lib/promise'); 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/muri/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/sliced/index.js: -------------------------------------------------------------------------------- 1 | module.exports = exports = require('./lib/sliced'); 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/sliced/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.10 5 | - 0.11 -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/string_decoder/.npmignore: -------------------------------------------------------------------------------- 1 | build 2 | test 3 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpath/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @node_modules/mocha/bin/mocha -A $(T) 4 | 5 | .PHONY: test 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.10 5 | - 0.11 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/muri/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @node_modules/mocha/bin/mocha $(T) 4 | 5 | .PHONY: test 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Export lib/mongoose 4 | * 5 | */ 6 | 7 | module.exports = require('./lib/'); 8 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/README.md: -------------------------------------------------------------------------------- 1 | kerberos 2 | ======== 3 | 4 | Kerberos library for node.js -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/.npmignore: -------------------------------------------------------------------------------- 1 | build/ 2 | test/ 3 | examples/ 4 | fs.js 5 | zlib.js -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha $(T) $(TESTS) 4 | 5 | .PHONY: test 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/regexp-clone/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | - 0.10 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/sliced/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha $(T) $(TESTS) 4 | 5 | .PHONY: test 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/duplex.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./lib/_stream_duplex.js") 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/regexp-clone/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.0.1 / 2013-04-17 3 | ================== 4 | 5 | * initial commit 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/transform.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./lib/_stream_transform.js") 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/writable.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./lib/_stream_writable.js") 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/passthrough.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./lib/_stream_passthrough.js") 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/node_modules/nan/include_dirs.js: -------------------------------------------------------------------------------- 1 | console.log(require('path').relative('.', __dirname)); 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inherits 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/regexp-clone/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha $(T) --async-only $(TESTS) 4 | 5 | .PHONY: test 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.10 5 | - 0.11 6 | services: 7 | - mongodb 8 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/worker.cc: -------------------------------------------------------------------------------- 1 | #include "worker.h" 2 | 3 | Worker::Worker() { 4 | } 5 | 6 | Worker::~Worker() { 7 | } -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.10 # development version of 0.8, may be unstable 4 | - 0.11 -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/worker.cc: -------------------------------------------------------------------------------- 1 | #include "worker.h" 2 | 3 | Worker::Worker() { 4 | } 5 | 6 | Worker::~Worker() { 7 | } -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/test/utils.js: -------------------------------------------------------------------------------- 1 | 2 | var utils = require('../lib/utils'); 3 | 4 | describe('utils', function(){ 5 | // TODO 6 | }) 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/core-util-is/README.md: -------------------------------------------------------------------------------- 1 | # core-util-is 2 | 3 | The `util.is*` functions introduced in Node v0.12. 4 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/ms/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | ./node_modules/.bin/mocha test/test.js 4 | 5 | test-browser: 6 | ./node_modules/.bin/serve test/ 7 | 8 | .PHONY: test 9 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/express/connection-sharing/README.md: -------------------------------------------------------------------------------- 1 | 2 | To run: 3 | 4 | - Execute `npm install` from this directory 5 | - Execute `node app.js` 6 | - Navigate to `localhost:8000` 7 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/drivers/node-mongodb-native/binary.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var Binary = require('mongodb').BSONPure.Binary; 7 | 8 | module.exports = exports = Binary; 9 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/.deps/Release/bson.node.d: -------------------------------------------------------------------------------- 1 | cmd_Release/bson.node := rm -rf "Release/bson.node" && cp -af "Release/obj.target/bson.node" "Release/bson.node" 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/bson.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gian788/docooment/HEAD/lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/bson.node -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/binding.Makefile: -------------------------------------------------------------------------------- 1 | # This file is generated by gyp; do not edit. 2 | 3 | export builddir_name ?= ./build/. 4 | .PHONY: all 5 | all: 6 | $(MAKE) bson 7 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/ext/win32/ia32/bson.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gian788/docooment/HEAD/lib/docoomentdb/node_modules/mongodb/node_modules/bson/ext/win32/ia32/bson.node -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/ext/win32/x64/bson.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gian788/docooment/HEAD/lib/docoomentdb/node_modules/mongodb/node_modules/bson/ext/win32/x64/bson.node -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/node_modules/debug/index.js: -------------------------------------------------------------------------------- 1 | if ('undefined' == typeof window) { 2 | module.exports = require('./lib/debug'); 3 | } else { 4 | module.exports = require('./debug'); 5 | } 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/binding.Makefile: -------------------------------------------------------------------------------- 1 | # This file is generated by gyp; do not edit. 2 | 3 | export builddir_name ?= ./build/. 4 | .PHONY: all 5 | all: 6 | $(MAKE) kerberos 7 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/Release/kerberos.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gian788/docooment/HEAD/lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/Release/kerberos.node -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/isarray/index.js: -------------------------------------------------------------------------------- 1 | module.exports = Array.isArray || function (arr) { 2 | return Object.prototype.toString.call(arr) == '[object Array]'; 3 | }; 4 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/obj.target/bson.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gian788/docooment/HEAD/lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/obj.target/bson.node -------------------------------------------------------------------------------- /lib/docoomentdb/examples/express/connection-sharing/modelA.js: -------------------------------------------------------------------------------- 1 | 2 | var Schema = require('../../../lib').Schema; 3 | var mySchema = Schema({ name: String }); 4 | 5 | // db is global 6 | module.exports = db.model('MyModel', mySchema); 7 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build_browser.js: -------------------------------------------------------------------------------- 1 | require('one'); 2 | 3 | one('./package.json') 4 | .tie('bson', BSON) 5 | // .exclude('buffer') 6 | .tie('buffer', {}) 7 | .save('./browser_build/bson.js') -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/Release/.deps/Release/kerberos.node.d: -------------------------------------------------------------------------------- 1 | cmd_Release/kerberos.node := rm -rf "Release/kerberos.node" && cp -af "Release/obj.target/kerberos.node" "Release/kerberos.node" 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/obj.target/bson/ext/bson.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gian788/docooment/HEAD/lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/obj.target/bson/ext/bson.o -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/tools/jasmine-1.1.0/jasmine_favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gian788/docooment/HEAD/lib/docoomentdb/node_modules/mongodb/node_modules/bson/tools/jasmine-1.1.0/jasmine_favicon.png -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/hooks/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @NODE_ENV=test ./node_modules/expresso/bin/expresso \ 3 | $(TESTFLAGS) \ 4 | ./test.js 5 | 6 | test-cov: 7 | @TESTFLAGS=--cov $(MAKE) test 8 | 9 | .PHONY: test test-cov 10 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/Release/obj.target/kerberos.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gian788/docooment/HEAD/lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/Release/obj.target/kerberos.node -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/other.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/wrappers/security_context.js: -------------------------------------------------------------------------------- 1 | var SecurityContextNative = require('../../../build/Release/kerberos').SecurityContext; 2 | // Export the modified class 3 | exports.SecurityContext = SecurityContextNative; -------------------------------------------------------------------------------- /lib/docoomentdb/examples/schema/storing-schemas-as-json/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "count": "number", 3 | "unit": "number", 4 | "description": "string", 5 | "links": ["string"], 6 | "created": "date", 7 | "additive": "boolean", 8 | "user_id": "ObjectId" 9 | } 10 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/index.js: -------------------------------------------------------------------------------- 1 | // Get the Kerberos library 2 | module.exports = require('./lib/kerberos'); 3 | // Set up the auth processes 4 | module.exports['processes'] = { 5 | MongoAuthProcess: require('./lib/auth_processes/mongodb').MongoAuthProcess 6 | } -------------------------------------------------------------------------------- /lib/types/objectid.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * ObjectId type constructor 4 | * 5 | * ####Example 6 | * 7 | * var id = new docooment.Types.ObjectId; 8 | * 9 | * @constructor ObjectId 10 | */ 11 | 12 | var ObjectId = require('bson').BSONPure.ObjectID; 13 | module.exports = ObjectId; 14 | 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/wrappers/security_buffer_descriptor.js: -------------------------------------------------------------------------------- 1 | var SecurityBufferDescriptorNative = require('../../../build/Release/kerberos').SecurityBufferDescriptor; 2 | // Export the modified class 3 | exports.SecurityBufferDescriptor = SecurityBufferDescriptorNative; -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/Release/.deps/Release/obj.target/kerberos.node.d: -------------------------------------------------------------------------------- 1 | cmd_Release/obj.target/kerberos.node := flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m64 -Wl,-soname=kerberos.node -o Release/obj.target/kerberos.node -Wl,--start-group -Wl,--end-group 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/.deps/Release/obj.target/bson.node.d: -------------------------------------------------------------------------------- 1 | cmd_Release/obj.target/bson.node := flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m64 -Wl,-soname=bson.node -o Release/obj.target/bson.node -Wl,--start-group Release/obj.target/bson/ext/bson.o -Wl,--end-group 2 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/lib/collection/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var env = require('../env') 4 | 5 | if ('unknown' == env.type) { 6 | throw new Error('Unknown environment') 7 | } 8 | 9 | module.exports = 10 | env.isNode ? require('./node') : 11 | env.isMongo ? require('./mongo') : 12 | require('./browser'); 13 | 14 | -------------------------------------------------------------------------------- /lib/types/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Module exports. 3 | */ 4 | 5 | exports.Array = require('./array'); 6 | //exports.Buffer = require('./buffer'); 7 | 8 | exports.Document = // @deprecate 9 | exports.Embedded = require('./embedded'); 10 | 11 | exports.DocumentArray = require('./documentarray'); 12 | exports.ObjectId = require('./objectid'); 13 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/types/index.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module exports. 4 | */ 5 | 6 | exports.Array = require('./array'); 7 | exports.Buffer = require('./buffer'); 8 | 9 | exports.Document = // @deprecate 10 | exports.Embedded = require('./embedded'); 11 | 12 | exports.DocumentArray = require('./documentarray'); 13 | exports.ObjectId = require('./objectid'); 14 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/drivers/node-mongodb-native/objectid.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) ObjectId 4 | * @constructor NodeMongoDbObjectId 5 | * @see ObjectId 6 | */ 7 | 8 | var ObjectId = require('mongodb').BSONPure.ObjectID; 9 | 10 | /*! 11 | * ignore 12 | */ 13 | 14 | module.exports = exports = ObjectId; 15 | 16 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/lib/bson/min_key.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A class representation of the BSON MinKey type. 3 | * 4 | * @class Represents the BSON MinKey type. 5 | * @return {MinKey} 6 | */ 7 | function MinKey() { 8 | if(!(this instanceof MinKey)) return new MinKey(); 9 | 10 | this._bsontype = 'MinKey'; 11 | } 12 | 13 | exports.MinKey = MinKey; -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpath/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.1.1 / 2012-12-21 3 | ================== 4 | 5 | * added; map support 6 | 7 | 0.1.0 / 2012-12-13 8 | ================== 9 | 10 | * added; set('array.property', val, object) support 11 | * added; get('array.property', object) support 12 | 13 | 0.0.1 / 2012-11-03 14 | ================== 15 | 16 | * initial release 17 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/lib/bson/max_key.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A class representation of the BSON MaxKey type. 3 | * 4 | * @class Represents the BSON MaxKey type. 5 | * @return {MaxKey} 6 | */ 7 | function MaxKey() { 8 | if(!(this instanceof MaxKey)) return new MaxKey(); 9 | 10 | this._bsontype = 'MaxKey'; 11 | } 12 | 13 | exports.MaxKey = MaxKey; -------------------------------------------------------------------------------- /lib/docoomentdb/examples/lean/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lean-example", 3 | "private": "true", 4 | "version": "0.0.0", 5 | "description": "deps for lean example", 6 | "main": "lean.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "dependencies": { "async": "*" }, 11 | "repository": "", 12 | "author": "", 13 | "license": "BSD" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/promises/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "promise-example", 3 | "private": "true", 4 | "version": "0.0.0", 5 | "description": "deps for promise example", 6 | "main": "promise.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "dependencies": { "async": "*" }, 11 | "repository": "", 12 | "author": "", 13 | "license": "BSD" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/aggregate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aggregate-example", 3 | "private": "true", 4 | "version": "0.0.0", 5 | "description": "deps for aggregate example", 6 | "main": "aggregate.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "dependencies": { "async": "*" }, 11 | "repository": "", 12 | "author": "", 13 | "license": "BSD" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/geospatial/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "geospatial-example", 3 | "private": "true", 4 | "version": "0.0.0", 5 | "description": "deps for geospatial example", 6 | "main": "geospatial.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "dependencies": { "async": "*" }, 11 | "repository": "", 12 | "author": "", 13 | "license": "BSD" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/mapreduce/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "map-reduce-example", 3 | "private": "true", 4 | "version": "0.0.0", 5 | "description": "deps for map reduce example", 6 | "main": "mapreduce.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "dependencies": { "async": "*" }, 11 | "repository": "", 12 | "author": "", 13 | "license": "BSD" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/replicasets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "replica-set-example", 3 | "private": "true", 4 | "version": "0.0.0", 5 | "description": "deps for replica set example", 6 | "main": "querybuilder.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "dependencies": { "async": "*" }, 11 | "repository": "", 12 | "author": "", 13 | "license": "BSD" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/querybuilder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "query-builder-example", 3 | "private": "true", 4 | "version": "0.0.0", 5 | "description": "deps for query builder example", 6 | "main": "querybuilder.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "dependencies": { "async": "*" }, 11 | "repository": "", 12 | "author": "", 13 | "license": "BSD" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/types/objectid.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Access driver. 4 | */ 5 | 6 | var driver = global.MONGOOSE_DRIVER_PATH || '../drivers/node-mongodb-native'; 7 | 8 | /** 9 | * ObjectId type constructor 10 | * 11 | * ####Example 12 | * 13 | * var id = new mongoose.Types.ObjectId; 14 | * 15 | * @constructor ObjectId 16 | */ 17 | 18 | var ObjectId = require(driver + '/objectid'); 19 | module.exports = ObjectId; 20 | 21 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/Makefile: -------------------------------------------------------------------------------- 1 | NODE = node 2 | NPM = npm 3 | NODEUNIT = node_modules/nodeunit/bin/nodeunit 4 | 5 | all: clean node_gyp 6 | 7 | test: clean node_gyp 8 | npm test 9 | 10 | node_gyp: clean 11 | node-gyp configure build 12 | 13 | clean: 14 | node-gyp clean 15 | 16 | browserify: 17 | node_modules/.bin/onejs build browser_build/package.json browser_build/bson.js 18 | 19 | .PHONY: all 20 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/regexp-clone/README.md: -------------------------------------------------------------------------------- 1 | #regexp-clone 2 | ============== 3 | 4 | Clones RegExps with flag preservation 5 | 6 | ```js 7 | var regexpClone = require('regexp-clone'); 8 | 9 | var a = /somethin/g; 10 | console.log(a.global); // true 11 | 12 | var b = regexpClone(a); 13 | console.log(b.global); // true 14 | ``` 15 | 16 | ## License 17 | 18 | [MIT](https://github.com/aheckmann/regexp-clone/blob/master/LICENSE) 19 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/express/connection-sharing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "connection-sharing", 3 | "private": "true", 4 | "version": "0.0.0", 5 | "description": "ERROR: No README.md file found!", 6 | "main": "app.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "dependencies": { "express": "3.1.1" }, 11 | "repository": "", 12 | "author": "", 13 | "license": "BSD" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/promises/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date 13 | }); 14 | mongoose.model('Person', PersonSchema); 15 | }; 16 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/querybuilder/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date 13 | }); 14 | mongoose.model('Person', PersonSchema); 15 | }; 16 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/replicasets/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date 13 | }); 14 | mongoose.model('Person', PersonSchema); 15 | }; 16 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/sliced/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sliced", 3 | "version": "0.0.5", 4 | "description": "A faster Node.js alternative to Array.prototype.slice.call(arguments)", 5 | "repo" : "aheckmann/sliced", 6 | "keywords": [ 7 | "arguments", 8 | "slice", 9 | "array" 10 | ], 11 | "scripts": ["lib/sliced.js", "index.js"], 12 | "author": "Aaron Heckmann ", 13 | "license": "MIT" 14 | } 15 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/globalschemas/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date 13 | }); 14 | mongoose.model('Person', PersonSchema); 15 | }; 16 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/browser_build/package.json: -------------------------------------------------------------------------------- 1 | { "name" : "bson" 2 | , "description" : "A bson parser for node.js and the browser" 3 | , "main": "../lib/bson/bson" 4 | , "directories" : { "lib" : "../lib/bson" } 5 | , "engines" : { "node" : ">=0.6.0" } 6 | , "licenses" : [ { "type" : "Apache License, Version 2.0" 7 | , "url" : "http://www.apache.org/licenses/LICENSE-2.0" } ] 8 | } 9 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/mapreduce/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date, 13 | gender: String 14 | }); 15 | mongoose.model('Person', PersonSchema); 16 | }; 17 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/jsLibraryMappings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/lean/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date, 13 | gender: String, 14 | likes: [String] 15 | }); 16 | mongoose.model('Person', PersonSchema); 17 | }; 18 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/aggregate/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date, 13 | gender: String, 14 | likes: [String] 15 | }); 16 | mongoose.model('Person', PersonSchema); 17 | }; 18 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/libraries/Node_js_Dependencies_for_mpromise.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/wrappers/security_buffer.js: -------------------------------------------------------------------------------- 1 | var SecurityBufferNative = require('../../../build/Release/kerberos').SecurityBuffer; 2 | 3 | // Add some attributes 4 | SecurityBufferNative.VERSION = 0; 5 | SecurityBufferNative.EMPTY = 0; 6 | SecurityBufferNative.DATA = 1; 7 | SecurityBufferNative.TOKEN = 2; 8 | SecurityBufferNative.PADDING = 9; 9 | SecurityBufferNative.STREAM = 10; 10 | 11 | // Export the modified class 12 | exports.SecurityBuffer = SecurityBufferNative; -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'bson', 5 | 'sources': [ 'ext/bson.cc' ], 6 | 'cflags!': [ '-fno-exceptions' ], 7 | 'cflags_cc!': [ '-fno-exceptions' ], 8 | 'include_dirs': [ ' 2 | 3 | 8 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/test/env.js: -------------------------------------------------------------------------------- 1 | 2 | var assert = require('assert') 3 | var env = require('../').env; 4 | 5 | console.log('environment: %s', env.type); 6 | 7 | var col; 8 | switch (env.type) { 9 | case 'node': 10 | col = require('./collection/node'); 11 | break; 12 | case 'mongo': 13 | col = require('./collection/mongo'); 14 | case 'browser': 15 | col = require('./collection/browser'); 16 | default: 17 | throw new Error('missing collection implementation for environment: ' + env.type); 18 | } 19 | 20 | module.exports = exports = col; 21 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/express/connection-sharing/routes.js: -------------------------------------------------------------------------------- 1 | 2 | var model = require('./modelA') 3 | 4 | exports.home = function (req, res, next) { 5 | model.find(function (err, docs) { 6 | if (err) return next(err); 7 | res.send(docs); 8 | }) 9 | } 10 | 11 | exports.modelName = function (req, res) { 12 | res.send('my model name is ' + model.modelName); 13 | } 14 | 15 | exports.insert = function (req, res, next) { 16 | model.create({ name: 'inserting ' + Date.now() }, function (err, doc) { 17 | if (err) return next(err); 18 | res.send(doc); 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/regexp-clone/index.js: -------------------------------------------------------------------------------- 1 | 2 | var toString = Object.prototype.toString; 3 | 4 | function isRegExp (o) { 5 | return 'object' == typeof o 6 | && '[object RegExp]' == toString.call(o); 7 | } 8 | 9 | module.exports = exports = function (regexp) { 10 | if (!isRegExp(regexp)) { 11 | throw new TypeError('Not a RegExp'); 12 | } 13 | 14 | var flags = []; 15 | if (regexp.global) flags.push('g'); 16 | if (regexp.multiline) flags.push('m'); 17 | if (regexp.ignoreCase) flags.push('i'); 18 | return new RegExp(regexp.source, flags.join('')); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/string_decoder/README.md: -------------------------------------------------------------------------------- 1 | **string_decoder.js** (`require('string_decoder')`) from Node.js core 2 | 3 | Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. 4 | 5 | Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** 6 | 7 | The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/ms/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ms.js tests 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/statics/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date 13 | }); 14 | 15 | // define a static 16 | PersonSchema.statics.findPersonByName = function (name, cb) { 17 | this.find({ name : new RegExp(name, 'i') }, cb); 18 | }; 19 | 20 | mongoose.model('Person', PersonSchema); 21 | }; 22 | -------------------------------------------------------------------------------- /lib/connectionstate.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Connection states 3 | */ 4 | 5 | var STATES = module.exports = exports = Object.create(null); 6 | 7 | var disconnected = 'disconnected'; 8 | var connected = 'connected'; 9 | var connecting = 'connecting'; 10 | var disconnecting = 'disconnecting'; 11 | var uninitialized = 'uninitialized'; 12 | 13 | STATES[0] = disconnected; 14 | STATES[1] = connected; 15 | STATES[2] = connecting; 16 | STATES[3] = disconnecting; 17 | STATES[99] = uninitialized; 18 | 19 | STATES[disconnected] = 0; 20 | STATES[connected] = 1; 21 | STATES[connecting] = 2; 22 | STATES[disconnecting] = 3; 23 | STATES[uninitialized] = 99; 24 | -------------------------------------------------------------------------------- /lib/schema/index.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module exports. 4 | */ 5 | 6 | exports.String = require('./string'); 7 | 8 | exports.Number = require('./number'); 9 | 10 | exports.Boolean = require('./boolean'); 11 | 12 | exports.DocumentArray = require('./documentarray'); 13 | 14 | exports.Array = require('./array'); 15 | 16 | //exports.Buffer = require('./buffer'); 17 | 18 | exports.Date = require('./date'); 19 | 20 | exports.ObjectId = require('./objectid'); 21 | 22 | exports.Mixed = require('./mixed'); 23 | 24 | // alias 25 | 26 | exports.Oid = exports.ObjectId; 27 | exports.Object = exports.Mixed; 28 | exports.Bool = exports.Boolean; 29 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/isarray/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "isarray", 3 | "description" : "Array#isArray for older browsers", 4 | "version" : "0.0.1", 5 | "repository" : "juliangruber/isarray", 6 | "homepage": "https://github.com/juliangruber/isarray", 7 | "main" : "index.js", 8 | "scripts" : [ 9 | "index.js" 10 | ], 11 | "dependencies" : {}, 12 | "keywords": ["browser","isarray","array"], 13 | "author": { 14 | "name": "Julian Gruber", 15 | "email": "mail@juliangruber.com", 16 | "url": "http://juliangruber.com" 17 | }, 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/Makefile: -------------------------------------------------------------------------------- 1 | NODE = node 2 | NPM = npm 3 | NODEUNIT = node_modules/nodeunit/bin/nodeunit 4 | DOX = node_modules/dox/bin/dox 5 | name = all 6 | 7 | total: build_native 8 | 9 | test_functional: 10 | node test/runner.js -t functional 11 | 12 | test_ssl: 13 | node test/runner.js -t ssl 14 | 15 | test_replicaset: 16 | node test/runner.js -t replicaset 17 | 18 | test_sharded: 19 | node test/runner.js -t sharded 20 | 21 | test_auth: 22 | node test/runner.js -t auth 23 | 24 | generate_docs: 25 | $(NODE) dev/tools/build-docs.js 26 | make --directory=./docs/sphinx-docs --file=Makefile html 27 | 28 | .PHONY: total 29 | -------------------------------------------------------------------------------- /lib/error/version.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var DocoomentError = require('../error.js'); 7 | 8 | /** 9 | * Version Error constructor. 10 | * 11 | * @inherits DocoomentError 12 | * @api private 13 | */ 14 | 15 | function VersionError () { 16 | DocoomentError.call(this, 'No matching document found.'); 17 | Error.captureStackTrace(this, arguments.callee); 18 | this.name = 'VersionError'; 19 | }; 20 | 21 | /*! 22 | * Inherits from DocoomentError. 23 | */ 24 | 25 | VersionError.prototype.__proto__ = DocoomentError.prototype; 26 | 27 | /*! 28 | * exports 29 | */ 30 | 31 | module.exports = VersionError; 32 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/schema/index.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module exports. 4 | */ 5 | 6 | exports.String = require('./string'); 7 | 8 | exports.Number = require('./number'); 9 | 10 | exports.Boolean = require('./boolean'); 11 | 12 | exports.DocumentArray = require('./documentarray'); 13 | 14 | exports.Array = require('./array'); 15 | 16 | exports.Buffer = require('./buffer'); 17 | 18 | exports.Date = require('./date'); 19 | 20 | exports.ObjectId = require('./objectid'); 21 | 22 | exports.Mixed = require('./mixed'); 23 | 24 | // alias 25 | 26 | exports.Oid = exports.ObjectId; 27 | exports.Object = exports.Mixed; 28 | exports.Bool = exports.Boolean; 29 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/connectionstate.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connection states 4 | */ 5 | 6 | var STATES = module.exports = exports = Object.create(null); 7 | 8 | var disconnected = 'disconnected'; 9 | var connected = 'connected'; 10 | var connecting = 'connecting'; 11 | var disconnecting = 'disconnecting'; 12 | var uninitialized = 'uninitialized'; 13 | 14 | STATES[0] = disconnected; 15 | STATES[1] = connected; 16 | STATES[2] = connecting; 17 | STATES[3] = disconnecting; 18 | STATES[99] = uninitialized; 19 | 20 | STATES[disconnected] = 0; 21 | STATES[connected] = 1; 22 | STATES[connecting] = 2; 23 | STATES[disconnecting] = 3; 24 | STATES[uninitialized] = 99; 25 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error/version.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var MongooseError = require('../error.js'); 7 | 8 | /** 9 | * Version Error constructor. 10 | * 11 | * @inherits MongooseError 12 | * @api private 13 | */ 14 | 15 | function VersionError () { 16 | MongooseError.call(this, 'No matching document found.'); 17 | Error.captureStackTrace(this, arguments.callee); 18 | this.name = 'VersionError'; 19 | }; 20 | 21 | /*! 22 | * Inherits from MongooseError. 23 | */ 24 | 25 | VersionError.prototype.__proto__ = MongooseError.prototype; 26 | 27 | /*! 28 | * exports 29 | */ 30 | 31 | module.exports = VersionError; 32 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/mpromise.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/error/overwriteModel.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var DocoomentError = require('../error.js'); 7 | 8 | /*! 9 | * OverwriteModel Error constructor. 10 | * 11 | * @inherits DocoomentError 12 | */ 13 | 14 | function OverwriteModelError (name) { 15 | DocoomentError.call(this, 'Cannot overwrite `' + name + '` model once compiled.'); 16 | Error.captureStackTrace(this, arguments.callee); 17 | this.name = 'OverwriteModelError'; 18 | }; 19 | 20 | /*! 21 | * Inherits from DocoomentError. 22 | */ 23 | 24 | OverwriteModelError.prototype.__proto__ = DocoomentError.prototype; 25 | 26 | /*! 27 | * exports 28 | */ 29 | 30 | module.exports = OverwriteModelError; 31 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error/overwriteModel.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var MongooseError = require('../error.js'); 7 | 8 | /*! 9 | * OverwriteModel Error constructor. 10 | * 11 | * @inherits MongooseError 12 | */ 13 | 14 | function OverwriteModelError (name) { 15 | MongooseError.call(this, 'Cannot overwrite `' + name + '` model once compiled.'); 16 | Error.captureStackTrace(this, arguments.callee); 17 | this.name = 'OverwriteModelError'; 18 | }; 19 | 20 | /*! 21 | * Inherits from MongooseError. 22 | */ 23 | 24 | OverwriteModelError.prototype.__proto__ = MongooseError.prototype; 25 | 26 | /*! 27 | * exports 28 | */ 29 | 30 | module.exports = OverwriteModelError; 31 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/inherits/test.js: -------------------------------------------------------------------------------- 1 | var inherits = require('./inherits.js') 2 | var assert = require('assert') 3 | 4 | function test(c) { 5 | assert(c.constructor === Child) 6 | assert(c.constructor.super_ === Parent) 7 | assert(Object.getPrototypeOf(c) === Child.prototype) 8 | assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) 9 | assert(c instanceof Child) 10 | assert(c instanceof Parent) 11 | } 12 | 13 | function Child() { 14 | Parent.call(this) 15 | test(this) 16 | } 17 | 18 | function Parent() {} 19 | 20 | inherits(Child, Parent) 21 | 22 | var c = new Child 23 | test(c) 24 | 25 | console.log('ok') 26 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/lib/bson/code.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A class representation of the BSON Code type. 3 | * 4 | * @class Represents the BSON Code type. 5 | * @param {String|Function} code a string or function. 6 | * @param {Object} [scope] an optional scope for the function. 7 | * @return {Code} 8 | */ 9 | var Code = function Code(code, scope) { 10 | if(!(this instanceof Code)) return new Code(code, scope); 11 | this._bsontype = 'Code'; 12 | this.code = code; 13 | this.scope = scope == null ? {} : scope; 14 | }; 15 | 16 | /** 17 | * @ignore 18 | * @api private 19 | */ 20 | Code.prototype.toJSON = function() { 21 | return {scope:this.scope, code:this.code}; 22 | } 23 | 24 | exports.Code = Code; -------------------------------------------------------------------------------- /lib/docoomentdb/examples/geospatial/geoJSONSchema.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | // NOTE : This object must conform *precisely* to the geoJSON specification 10 | // you cannot embed a geoJSON doc inside a model or anything like that- IT 11 | // MUST BE VANILLA 12 | var LocationObject = new Schema({ 13 | loc: { 14 | type: { type: String }, 15 | coordinates: [] 16 | } 17 | }); 18 | // define the index 19 | LocationObject.index({ loc : '2dsphere' }); 20 | 21 | mongoose.model('Location', LocationObject); 22 | }; 23 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/sliced/lib/sliced.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * An Array.prototype.slice.call(arguments) alternative 4 | * 5 | * @param {Object} args something with a length 6 | * @param {Number} slice 7 | * @param {Number} sliceEnd 8 | * @api public 9 | */ 10 | 11 | module.exports = function (args, slice, sliceEnd) { 12 | var ret = []; 13 | var len = args.length; 14 | 15 | if (0 === len) return ret; 16 | 17 | var start = slice < 0 18 | ? Math.max(0, slice + len) 19 | : slice || 0; 20 | 21 | if (sliceEnd !== undefined) { 22 | len = sliceEnd < 0 23 | ? sliceEnd + len 24 | : sliceEnd 25 | } 26 | 27 | while (len-- > start) { 28 | ret[len - start] = args[len]; 29 | } 30 | 31 | return ret; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /test/test-query.js: -------------------------------------------------------------------------------- 1 | var queryComposer = require('../lib/querycomposer'); 2 | 3 | var select = { 4 | /*firstName: 'Gianluca', 5 | id: {$in: [1, 2, 3]}, 6 | age: {$gt: 18, $lt: 30, $ne: 25}, 7 | score: {$gte: 5, $lte: 10,}, 8 | lastName: {$ne: 'Pengo'}, 9 | city: {$nin: ['Milano', 'Roma']}, 10 | interest: {$all: ['travel', 'sport']}, 11 | visitedCity: {$elementMatch: ['london', 'paris', 'madrid']}, 12 | likes: {$size: 3}, 13 | banned: {$exist: true}, 14 | date: {$type: 'date'}, 15 | qty: {$mod: [4,0]}, 16 | fullName: {$regex: /gian/},*/ 17 | $not: {qty: {$mod: [4,0]}} 18 | 19 | }; 20 | 21 | var fields = { 22 | // firstName: 1, 23 | lastName: 0, 24 | // subs: {$slice: 2}, 25 | } 26 | 27 | 28 | console.log(queryComposer.composeQuery(select, fields, model)); -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/ext/Makefile: -------------------------------------------------------------------------------- 1 | NODE = node 2 | name = all 3 | JOBS = 1 4 | 5 | all: 6 | rm -rf build .lock-wscript bson.node 7 | node-waf configure build 8 | cp -R ./build/Release/bson.node . || true 9 | 10 | all_debug: 11 | rm -rf build .lock-wscript bson.node 12 | node-waf --debug configure build 13 | cp -R ./build/Release/bson.node . || true 14 | 15 | clang: 16 | rm -rf build .lock-wscript bson.node 17 | CXX=clang node-waf configure build 18 | cp -R ./build/Release/bson.node . || true 19 | 20 | clang_debug: 21 | rm -rf build .lock-wscript bson.node 22 | CXX=clang node-waf --debug configure build 23 | cp -R ./build/Release/bson.node . || true 24 | 25 | clean: 26 | rm -rf build .lock-wscript bson.node 27 | 28 | .PHONY: all -------------------------------------------------------------------------------- /lib/error/missingSchema.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var DocoomentError = require('../error.js'); 7 | 8 | /*! 9 | * MissingSchema Error constructor. 10 | * 11 | * @inherits DocoomentError 12 | */ 13 | 14 | function MissingSchemaError (name) { 15 | var msg = 'Schema hasn\'t been registered for model "' + name + '".\n' 16 | + 'Use Docooment.model(name, schema)'; 17 | DocoomentError.call(this, msg); 18 | Error.captureStackTrace(this, arguments.callee); 19 | this.name = 'MissingSchemaError'; 20 | }; 21 | 22 | /*! 23 | * Inherits from DocoomentError. 24 | */ 25 | 26 | MissingSchemaError.prototype.__proto__ = DocoomentError.prototype; 27 | 28 | /*! 29 | * exports 30 | */ 31 | 32 | module.exports = MissingSchemaError; 33 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/schema/storing-schemas-as-json/index.js: -------------------------------------------------------------------------------- 1 | 2 | // modules 3 | var mongoose = require('../../../lib') 4 | var Schema = mongoose.Schema; 5 | 6 | // parse json 7 | var raw = require('./schema.json'); 8 | 9 | // create a schema 10 | var timeSignatureSchema = Schema(raw); 11 | 12 | // compile the model 13 | var TimeSignature = mongoose.model('TimeSignatures', timeSignatureSchema); 14 | 15 | // create a TimeSignature document 16 | var threeFour = new TimeSignature({ 17 | count: 3 18 | , unit: 4 19 | , description: "3/4" 20 | , additive: false 21 | , created: new Date 22 | , links: ["http://en.wikipedia.org/wiki/Time_signature"] 23 | , user_id: "518d31a0ef32bbfa853a9814" 24 | }); 25 | 26 | // print its description 27 | console.log(threeFour) 28 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error/missingSchema.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var MongooseError = require('../error.js'); 7 | 8 | /*! 9 | * MissingSchema Error constructor. 10 | * 11 | * @inherits MongooseError 12 | */ 13 | 14 | function MissingSchemaError (name) { 15 | var msg = 'Schema hasn\'t been registered for model "' + name + '".\n' 16 | + 'Use mongoose.model(name, schema)'; 17 | MongooseError.call(this, msg); 18 | Error.captureStackTrace(this, arguments.callee); 19 | this.name = 'MissingSchemaError'; 20 | }; 21 | 22 | /*! 23 | * Inherits from MongooseError. 24 | */ 25 | 26 | MissingSchemaError.prototype.__proto__ = MongooseError.prototype; 27 | 28 | /*! 29 | * exports 30 | */ 31 | 32 | module.exports = MissingSchemaError; 33 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/lib/env.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.isNode = 'undefined' != typeof process 4 | && 'object' == typeof module 5 | && 'object' == typeof global 6 | && 'function' == typeof Buffer 7 | && process.argv 8 | 9 | exports.isMongo = !exports.isNode 10 | && 'function' == typeof printjson 11 | && 'function' == typeof ObjectId 12 | && 'function' == typeof rs 13 | && 'function' == typeof sh; 14 | 15 | exports.isBrowser = !exports.isNode 16 | && !exports.isMongo 17 | && 'undefined' != typeof window; 18 | 19 | exports.type = exports.isNode ? 'node' 20 | : exports.isMongo ? 'mongo' 21 | : exports.isBrowser ? 'browser' 22 | : 'unknown' 23 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/sliced/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.0.5 / 2013-02-05 3 | ================== 4 | 5 | * optimization: remove use of arguments [jkroso](https://github.com/jkroso) 6 | * add scripts to component.json [jkroso](https://github.com/jkroso) 7 | * tests; remove time for travis 8 | 9 | 0.0.4 / 2013-01-07 10 | ================== 11 | 12 | * added component.json #1 [jkroso](https://github.com/jkroso) 13 | * reversed array loop #1 [jkroso](https://github.com/jkroso) 14 | * remove fn params 15 | 16 | 0.0.3 / 2012-09-29 17 | ================== 18 | 19 | * faster with negative start args 20 | 21 | 0.0.2 / 2012-09-29 22 | ================== 23 | 24 | * support full [].slice semantics 25 | 26 | 0.0.1 / 2012-09-29 27 | =================== 28 | 29 | * initial release 30 | 31 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/test/collection/node.js: -------------------------------------------------------------------------------- 1 | 2 | var assert = require('assert') 3 | var slice = require('sliced') 4 | var mongo = require('mongodb') 5 | var utils = require('../../').utils; 6 | 7 | var uri = process.env.MQUERY_URI || 'mongodb://localhost/mquery'; 8 | var db; 9 | 10 | exports.getCollection = function (cb) { 11 | mongo.Db.connect(uri, function (err, db_) { 12 | assert.ifError(err); 13 | db = db_; 14 | 15 | var collection = db.collection('stuff'); 16 | collection.opts.safe = true; 17 | 18 | // clean test db before starting 19 | db.dropDatabase(function () { 20 | cb(null, collection); 21 | }); 22 | }) 23 | } 24 | 25 | exports.dropCollection = function (cb) { 26 | db.dropDatabase(function () { 27 | db.close(cb); 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/tools/gleak.js: -------------------------------------------------------------------------------- 1 | 2 | var gleak = require('gleak')(); 3 | gleak.ignore('AssertionError'); 4 | gleak.ignore('testFullSpec_param_found'); 5 | gleak.ignore('events'); 6 | gleak.ignore('Uint8Array'); 7 | gleak.ignore('Uint8ClampedArray'); 8 | gleak.ignore('TAP_Global_Harness'); 9 | gleak.ignore('setImmediate'); 10 | gleak.ignore('clearImmediate'); 11 | 12 | gleak.ignore('DTRACE_NET_SERVER_CONNECTION'); 13 | gleak.ignore('DTRACE_NET_STREAM_END'); 14 | gleak.ignore('DTRACE_NET_SOCKET_READ'); 15 | gleak.ignore('DTRACE_NET_SOCKET_WRITE'); 16 | gleak.ignore('DTRACE_HTTP_SERVER_REQUEST'); 17 | gleak.ignore('DTRACE_HTTP_SERVER_RESPONSE'); 18 | gleak.ignore('DTRACE_HTTP_CLIENT_REQUEST'); 19 | gleak.ignore('DTRACE_HTTP_CLIENT_RESPONSE'); 20 | 21 | module.exports = gleak; 22 | -------------------------------------------------------------------------------- /lib/error/cast.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Module dependencies. 3 | */ 4 | 5 | var DocoomentError = require('../error.js'); 6 | 7 | /** 8 | * Casting Error constructor. 9 | * 10 | * @param {String} type 11 | * @param {String} value 12 | * @inherits DocoomentError 13 | * @api private 14 | */ 15 | 16 | function CastError (type, value, path) { 17 | DocoomentError.call(this, 'Cast to ' + type + ' failed for value "' + value + '" at path "' + path + '"'); 18 | Error.captureStackTrace(this, arguments.callee); 19 | this.name = 'CastError'; 20 | this.type = type; 21 | this.value = value; 22 | this.path = path; 23 | }; 24 | 25 | /*! 26 | * Inherits from DocoomentError. 27 | */ 28 | 29 | CastError.prototype.__proto__ = DocoomentError.prototype; 30 | 31 | /*! 32 | * exports 33 | */ 34 | 35 | module.exports = CastError; 36 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/test/win32/security_buffer_tests.js: -------------------------------------------------------------------------------- 1 | exports.setUp = function(callback) { 2 | callback(); 3 | } 4 | 5 | exports.tearDown = function(callback) { 6 | callback(); 7 | } 8 | 9 | exports['Initialize a security Buffer'] = function(test) { 10 | var SecurityBuffer = require('../../lib/sspi.js').SecurityBuffer; 11 | // Create empty buffer 12 | var securityBuffer = new SecurityBuffer(SecurityBuffer.DATA, 100); 13 | var buffer = securityBuffer.toBuffer(); 14 | test.equal(100, buffer.length); 15 | 16 | // Access data passed in 17 | var allocated_buffer = new Buffer(256); 18 | securityBuffer = new SecurityBuffer(SecurityBuffer.DATA, allocated_buffer); 19 | buffer = securityBuffer.toBuffer(); 20 | test.deepEqual(allocated_buffer, buffer); 21 | test.done(); 22 | } -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error/cast.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Module dependencies. 3 | */ 4 | 5 | var MongooseError = require('../error.js'); 6 | 7 | /** 8 | * Casting Error constructor. 9 | * 10 | * @param {String} type 11 | * @param {String} value 12 | * @inherits MongooseError 13 | * @api private 14 | */ 15 | 16 | function CastError (type, value, path) { 17 | MongooseError.call(this, 'Cast to ' + type + ' failed for value "' + value + '" at path "' + path + '"'); 18 | Error.captureStackTrace(this, arguments.callee); 19 | this.name = 'CastError'; 20 | this.type = type; 21 | this.value = value; 22 | this.path = path; 23 | }; 24 | 25 | /*! 26 | * Inherits from MongooseError. 27 | */ 28 | 29 | CastError.prototype.__proto__ = MongooseError.prototype; 30 | 31 | /*! 32 | * exports 33 | */ 34 | 35 | module.exports = CastError; 36 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/test/kerberos_win32_test.js: -------------------------------------------------------------------------------- 1 | exports.setUp = function(callback) { 2 | callback(); 3 | } 4 | 5 | exports.tearDown = function(callback) { 6 | callback(); 7 | } 8 | 9 | exports['Simple initialize of Kerberos win32 object'] = function(test) { 10 | var KerberosNative = require('../build/Release/kerberos').Kerberos; 11 | // console.dir(KerberosNative) 12 | var kerberos = new KerberosNative(); 13 | console.log("=========================================== 0") 14 | console.dir(kerberos.acquireAlternateCredentials("dev1@10GEN.ME", "a")); 15 | console.log("=========================================== 1") 16 | console.dir(kerberos.prepareOutboundPackage("mongodb/kdc.10gen.com")); 17 | console.log("=========================================== 2") 18 | test.done(); 19 | } 20 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/ms/ms.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | # ms.js 4 | 5 | No more painful `setTimeout(fn, 60 * 4 * 3 * 2 * 1 * Infinity * NaN * '☃')`. 6 | 7 | ms('2d') // 172800000 8 | ms('1.5h') // 5400000 9 | ms('1h') // 3600000 10 | ms('1m') // 60000 11 | ms('5s') // 5000 12 | ms('500ms') // 500 13 | ms('100') // '100' 14 | ms(100) // 100 15 | 16 | **/ 17 | 18 | (function (g) { 19 | var r = /(\d*.?\d+)([mshd]+)/ 20 | , _ = {} 21 | 22 | _.ms = 1; 23 | _.s = 1000; 24 | _.m = _.s * 60; 25 | _.h = _.m * 60; 26 | _.d = _.h * 24; 27 | 28 | function ms (s) { 29 | if (s == Number(s)) return Number(s); 30 | r.exec(s.toLowerCase()); 31 | return RegExp.$1 * _[RegExp.$2]; 32 | } 33 | 34 | g.top ? g.ms = ms : module.exports = ms; 35 | })(this); 36 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/lib/bson/double.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A class representation of the BSON Double type. 3 | * 4 | * @class Represents the BSON Double type. 5 | * @param {Number} value the number we want to represent as a double. 6 | * @return {Double} 7 | */ 8 | function Double(value) { 9 | if(!(this instanceof Double)) return new Double(value); 10 | 11 | this._bsontype = 'Double'; 12 | this.value = value; 13 | } 14 | 15 | /** 16 | * Access the number value. 17 | * 18 | * @return {Number} returns the wrapped double number. 19 | * @api public 20 | */ 21 | Double.prototype.valueOf = function() { 22 | return this.value; 23 | }; 24 | 25 | /** 26 | * @ignore 27 | * @api private 28 | */ 29 | Double.prototype.toJSON = function() { 30 | return this.value; 31 | } 32 | 33 | exports.Double = Double; -------------------------------------------------------------------------------- /lib/docoomentdb/lib/schemadefault.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var Schema = require('./schema') 7 | 8 | /** 9 | * Default model for querying the system.profiles collection. 10 | * 11 | * @property system.profile 12 | * @receiver exports 13 | * @api private 14 | */ 15 | 16 | exports['system.profile'] = new Schema({ 17 | ts: Date 18 | , info: String // deprecated 19 | , millis: Number 20 | , op: String 21 | , ns: String 22 | , query: Schema.Types.Mixed 23 | , updateobj: Schema.Types.Mixed 24 | , ntoreturn: Number 25 | , nreturned: Number 26 | , nscanned: Number 27 | , responseLength: Number 28 | , client: String 29 | , user: String 30 | , idhack: Boolean 31 | , scanAndOrder: Boolean 32 | , keyUpdates: Number 33 | , cursorid: Number 34 | }, { noVirtualId: true, noId: true }); 35 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/sspi.js: -------------------------------------------------------------------------------- 1 | // Load the native SSPI classes 2 | var kerberos = require('../build/Release/kerberos') 3 | , Kerberos = kerberos.Kerberos 4 | , SecurityBuffer = require('./win32/wrappers/security_buffer').SecurityBuffer 5 | , SecurityBufferDescriptor = require('./win32/wrappers/security_buffer_descriptor').SecurityBufferDescriptor 6 | , SecurityCredentials = require('./win32/wrappers/security_credentials').SecurityCredentials 7 | , SecurityContext = require('./win32/wrappers/security_context').SecurityContext; 8 | var SSPI = function() { 9 | } 10 | 11 | exports.SSPI = SSPI; 12 | exports.SecurityBuffer = SecurityBuffer; 13 | exports.SecurityBufferDescriptor = SecurityBufferDescriptor; 14 | exports.SecurityCredentials = SecurityCredentials; 15 | exports.SecurityContext = SecurityContext; -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | ctor.super_ = superCtor 5 | ctor.prototype = Object.create(superCtor.prototype, { 6 | constructor: { 7 | value: ctor, 8 | enumerable: false, 9 | writable: true, 10 | configurable: true 11 | } 12 | }); 13 | }; 14 | } else { 15 | // old school shim for old browsers 16 | module.exports = function inherits(ctor, superCtor) { 17 | ctor.super_ = superCtor 18 | var TempCtor = function () {} 19 | TempCtor.prototype = superCtor.prototype 20 | ctor.prototype = new TempCtor() 21 | ctor.prototype.constructor = ctor 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/geospatial/person.js: -------------------------------------------------------------------------------- 1 | 2 | // import the necessary modules 3 | var mongoose = require('../../lib'); 4 | var Schema = mongoose.Schema; 5 | 6 | // create an export function to encapsulate the model creation 7 | module.exports = function() { 8 | // define schema 9 | var PersonSchema = new Schema({ 10 | name : String, 11 | age : Number, 12 | birthday : Date, 13 | gender: String, 14 | likes: [String], 15 | // define the geospatial field 16 | loc: { type : [Number], index: '2d' } 17 | }); 18 | 19 | // define a method to find the closest person 20 | PersonSchema.methods.findClosest = function(cb) { 21 | return this.model('Person').find({ 22 | loc : { $nearSphere : this.loc }, 23 | name : { $ne : this.name } 24 | }).limit(1).exec(cb); 25 | }; 26 | 27 | mongoose.model('Person', PersonSchema); 28 | }; 29 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/lib/collection/collection.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * methods a collection must implement 5 | */ 6 | 7 | var names = 'find findOne update remove count distict findAndModify aggregate'; 8 | var methods = names.split(' '); 9 | 10 | /** 11 | * Collection base class from which implementations inherit 12 | */ 13 | 14 | function Collection () {} 15 | 16 | for (var i = 0, len = methods.length; i < len; ++i) { 17 | var method = methods[i]; 18 | Collection.prototype[method] = notImplemented(method); 19 | } 20 | 21 | module.exports = exports = Collection; 22 | Collection.methods = methods; 23 | 24 | /** 25 | * creates a function which throws an implementation error 26 | */ 27 | 28 | function notImplemented (method) { 29 | return function () { 30 | throw new Error('collection.' + method + ' not implemented'); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/base64.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2006-2008 Apple Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | 17 | char *base64_encode(const unsigned char *value, int vlen); 18 | unsigned char *base64_decode(const char *value, int *rlen); 19 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/test/promise.domain.test.js: -------------------------------------------------------------------------------- 1 | var Promise = require('../') 2 | , Domain = require('domain') 3 | , assert = require('assert'); 4 | 5 | var next = 'function' == typeof setImmediate 6 | ? setImmediate 7 | : process.nextTick; 8 | 9 | describe("domains", function () { 10 | it("exceptions should not breakout of domain bounderies", function (done) { 11 | if (process.version.indexOf('v0.8') == 0) return done(); 12 | var d = Domain.create(); 13 | d.once('error', function (err) { 14 | assert.equal(err.message, 'gaga'); 15 | done() 16 | }); 17 | 18 | var p = new Promise(); 19 | 20 | d.run(function () { 21 | p.then(function () { 22 | 23 | }).then(function () { 24 | throw new Error('gaga'); 25 | }).end(); 26 | }); 27 | 28 | next(function () { 29 | p.fulfill(); 30 | }) 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/lib/bson/db_ref.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A class representation of the BSON DBRef type. 3 | * 4 | * @class Represents the BSON DBRef type. 5 | * @param {String} namespace the collection name. 6 | * @param {ObjectID} oid the reference ObjectID. 7 | * @param {String} [db] optional db name, if omitted the reference is local to the current db. 8 | * @return {DBRef} 9 | */ 10 | function DBRef(namespace, oid, db) { 11 | if(!(this instanceof DBRef)) return new DBRef(namespace, oid, db); 12 | 13 | this._bsontype = 'DBRef'; 14 | this.namespace = namespace; 15 | this.oid = oid; 16 | this.db = db; 17 | }; 18 | 19 | /** 20 | * @ignore 21 | * @api private 22 | */ 23 | DBRef.prototype.toJSON = function() { 24 | return { 25 | '$ref':this.namespace, 26 | '$id':this.oid, 27 | '$db':this.db == null ? '' : this.db 28 | }; 29 | } 30 | 31 | exports.DBRef = DBRef; -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/base64.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2006-2008 Apple Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | **/ 16 | #ifndef BASE64_H 17 | #define BASE64_H 18 | 19 | char *base64_encode(const unsigned char *value, int vlen); 20 | unsigned char *base64_decode(const char *value, int *rlen); 21 | 22 | #endif -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/wrappers/security_credentials.js: -------------------------------------------------------------------------------- 1 | var SecurityCredentialsNative = require('../../../build/Release/kerberos').SecurityCredentials; 2 | 3 | // Add simple kebros helper 4 | SecurityCredentialsNative.aquire_kerberos = function(username, password, domain, callback) { 5 | if(typeof password == 'function') { 6 | callback = password; 7 | password = null; 8 | } else if(typeof domain == 'function') { 9 | callback = domain; 10 | domain = null; 11 | } 12 | 13 | // We are going to use the async version 14 | if(typeof callback == 'function') { 15 | return SecurityCredentialsNative.aquire('Kerberos', username, password, domain, callback); 16 | } else { 17 | return SecurityCredentialsNative.aquireSync('Kerberos', username, password, domain); 18 | } 19 | } 20 | 21 | // Export the modified class 22 | exports.SecurityCredentials = SecurityCredentialsNative; -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/node_modules/nan/.dntrc: -------------------------------------------------------------------------------- 1 | ## DNT config file 2 | ## see https://github.com/rvagg/dnt 3 | 4 | NODE_VERSIONS="\ 5 | master \ 6 | v0.11.13 \ 7 | v0.10.30 \ 8 | v0.10.29 \ 9 | v0.10.28 \ 10 | v0.10.26 \ 11 | v0.10.25 \ 12 | v0.10.24 \ 13 | v0.10.23 \ 14 | v0.10.22 \ 15 | v0.10.21 \ 16 | v0.10.20 \ 17 | v0.10.19 \ 18 | v0.8.28 \ 19 | v0.8.27 \ 20 | v0.8.26 \ 21 | v0.8.24 \ 22 | " 23 | OUTPUT_PREFIX="nan-" 24 | TEST_CMD=" \ 25 | cd /dnt/ && \ 26 | npm install && \ 27 | node_modules/.bin/node-gyp --nodedir /usr/src/node/ rebuild --directory test && \ 28 | node_modules/.bin/tap --gc test/js/*-test.js \ 29 | " 30 | 31 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/lib/mongodb/commands/base_command.js: -------------------------------------------------------------------------------- 1 | /** 2 | Base object used for common functionality 3 | **/ 4 | var BaseCommand = exports.BaseCommand = function BaseCommand() { 5 | }; 6 | 7 | var id = 1; 8 | BaseCommand.prototype.getRequestId = function getRequestId() { 9 | if (!this.requestId) this.requestId = id++; 10 | return this.requestId; 11 | }; 12 | 13 | BaseCommand.prototype.setMongosReadPreference = function setMongosReadPreference(readPreference, tags) {} 14 | 15 | BaseCommand.prototype.updateRequestId = function() { 16 | this.requestId = id++; 17 | return this.requestId; 18 | }; 19 | 20 | // OpCodes 21 | BaseCommand.OP_REPLY = 1; 22 | BaseCommand.OP_MSG = 1000; 23 | BaseCommand.OP_UPDATE = 2001; 24 | BaseCommand.OP_INSERT = 2002; 25 | BaseCommand.OP_GET_BY_OID = 2003; 26 | BaseCommand.OP_QUERY = 2004; 27 | BaseCommand.OP_GET_MORE = 2005; 28 | BaseCommand.OP_DELETE = 2006; 29 | BaseCommand.OP_KILL_CURSORS = 2007; -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/worker.h: -------------------------------------------------------------------------------- 1 | #ifndef WORKER_H_ 2 | #define WORKER_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace node; 9 | using namespace v8; 10 | 11 | class Worker { 12 | public: 13 | Worker(); 14 | virtual ~Worker(); 15 | 16 | // libuv's request struct. 17 | uv_work_t request; 18 | // Callback 19 | v8::Persistent callback; 20 | // Parameters 21 | void *parameters; 22 | // Results 23 | void *return_value; 24 | // Did we raise an error 25 | bool error; 26 | // The error message 27 | char *error_message; 28 | // Error code if not message 29 | int error_code; 30 | // Any return code 31 | int return_code; 32 | // Method we are going to fire 33 | void (*execute)(Worker *worker); 34 | Handle (*mapper)(Worker *worker); 35 | }; 36 | 37 | #endif // WORKER_H_ 38 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/node_modules/nan/appveyor.yml: -------------------------------------------------------------------------------- 1 | # http://www.appveyor.com/docs/appveyor-yml 2 | 3 | # Test against these versions of Node.js. 4 | environment: 5 | matrix: 6 | - nodejs_version: "0.8" 7 | - nodejs_version: "0.10" 8 | - nodejs_version: "0.11" 9 | 10 | # Install scripts. (runs after repo cloning) 11 | install: 12 | # Get the latest stable version of Node 0.STABLE.latest 13 | - npm install npm 14 | - move node_modules npm 15 | - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) 16 | # Typical npm stuff. 17 | - npm/.bin/npm install 18 | - npm/.bin/npm run rebuild-tests 19 | 20 | # Post-install test scripts. 21 | test_script: 22 | # Output useful info for debugging. 23 | - node --version 24 | - npm --version 25 | - cmd: npm test 26 | 27 | # Don't actually build. 28 | build: off 29 | 30 | # Set build version format here instead of in the admin panel. 31 | version: "{build}" 32 | 33 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/muri/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.3.1 / 2013-02-17 3 | ================== 4 | 5 | * fixed; allow '#' in username and password #3 6 | 7 | 0.3.0 / 2013-01-14 8 | ================== 9 | 10 | * fixed; default db logic #2 11 | 12 | 0.2.0 / 2013-01-09 13 | ================== 14 | 15 | * changed; default db is now 'test' 16 | 17 | 0.1.0 / 2012-12-18 18 | ================== 19 | 20 | * changed; include .sock in UDS 21 | 22 | 0.0.5 / 2012-12-18 23 | ================== 24 | 25 | * fixed; unix domain sockets used with db names 26 | 27 | 0.0.4 / 2012-12-01 28 | ================== 29 | 30 | * handle multple specified protocols 31 | 32 | 0.0.3 / 2012-11-29 33 | ================== 34 | 35 | * validate mongodb:///db 36 | * more detailed error message 37 | 38 | 0.0.2 / 2012-11-02 39 | ================== 40 | 41 | * add readPreferenceTags support 42 | * add unix domain support 43 | 44 | 0.0.1 / 2012-11-01 45 | ================== 46 | 47 | * initial release 48 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/statics/statics.js: -------------------------------------------------------------------------------- 1 | 2 | var mongoose = require('../../lib'); 3 | 4 | 5 | // import the schema 6 | require('./person.js')(); 7 | 8 | // grab the person model object 9 | var Person = mongoose.model("Person"); 10 | 11 | // connect to a server to do a quick write / read example 12 | 13 | mongoose.connect('mongodb://localhost/persons', function(err) { 14 | if (err) throw err; 15 | 16 | Person.create({ 17 | name : 'bill', 18 | age : 25, 19 | birthday : new Date().setFullYear((new Date().getFullYear() - 25)) 20 | }, function (err, bill) { 21 | if (err) throw err; 22 | console.log("People added to db: %s", bill.toString()); 23 | 24 | // using the static 25 | Person.findPersonByName('bill', function(err, result) { 26 | if (err) throw err; 27 | 28 | console.log(result); 29 | cleanup(); 30 | }); 31 | }); 32 | }); 33 | 34 | function cleanup() { 35 | Person.remove(function() { 36 | mongoose.disconnect(); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/worker.h: -------------------------------------------------------------------------------- 1 | #ifndef WORKER_H_ 2 | #define WORKER_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace node; 9 | using namespace v8; 10 | 11 | class Worker { 12 | public: 13 | Worker(); 14 | virtual ~Worker(); 15 | 16 | // libuv's request struct. 17 | uv_work_t request; 18 | // Callback 19 | v8::Persistent callback; 20 | // // Arguments 21 | // v8::Persistent arguments; 22 | // Parameters 23 | void *parameters; 24 | // Results 25 | void *return_value; 26 | // Did we raise an error 27 | bool error; 28 | // The error message 29 | char *error_message; 30 | // Error code if not message 31 | int error_code; 32 | // Any return code 33 | int return_code; 34 | // Method we are going to fire 35 | void (*execute)(Worker *worker); 36 | Handle (*mapper)(Worker *worker); 37 | }; 38 | 39 | #endif // WORKER_H_ 40 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/test/promises.Aplus.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var Promise = require('../lib/promise'); 6 | var aplus = require('promises-aplus-tests'); 7 | 8 | // tests 9 | 10 | var adapter = {}; 11 | adapter.fulfilled = function (value) { 12 | var p = new Promise; 13 | p.fulfill(value); 14 | return p; 15 | }; 16 | adapter.rejected = function (reason) { 17 | var p = new Promise; 18 | p.reject(reason); 19 | return p; 20 | } 21 | adapter.deferred = function () { 22 | var p = new Promise; 23 | return { 24 | promise: p, reject: p.reject.bind(p), resolve: p.fulfill.bind(p) 25 | } 26 | } 27 | 28 | it("run A+ suite", function (done) { 29 | this.timeout(60000); 30 | aplus(adapter, { 31 | reporter: 'spec', slow: 1 32 | 33 | // , bail:true 34 | // , grep:'2.3.1: If `promise` and `x` refer to the same object, reject `promise` with a `TypeError` as the reason. via return from a fulfilled promise' 35 | }, function (err) { 36 | done(err); 37 | }); 38 | }); 39 | 40 | -------------------------------------------------------------------------------- /lib/internal.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Dependencies 3 | */ 4 | 5 | var StateMachine = require('./statemachine') 6 | var ActiveRoster = StateMachine.ctor('require', 'modify', 'init', 'default', 'ignore'); 7 | 8 | module.exports = exports = InternalCache; 9 | 10 | function InternalCache () { 11 | this.strictMode = undefined; 12 | this.selected = undefined; 13 | this.shardval = undefined; 14 | this.saveError = undefined; 15 | this.validationError = undefined; 16 | this.adhocPaths = undefined; 17 | this.removing = undefined; 18 | this.inserting = undefined; 19 | this.version = undefined; 20 | this.getters = {}; 21 | this._id = undefined; 22 | this.populate = undefined; // what we want to populate in this doc 23 | this.populated = undefined;// the _ids that have been populated 24 | this.wasPopulated = false; // if this doc was the result of a population 25 | this.scope = undefined; 26 | this.activePaths = new ActiveRoster; 27 | 28 | // embedded docs 29 | this.ownerDocument = undefined; 30 | this.fullPath = undefined; 31 | } 32 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/internal.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Dependencies 3 | */ 4 | 5 | var StateMachine = require('./statemachine') 6 | var ActiveRoster = StateMachine.ctor('require', 'modify', 'init', 'default', 'ignore'); 7 | 8 | module.exports = exports = InternalCache; 9 | 10 | function InternalCache () { 11 | this.strictMode = undefined; 12 | this.selected = undefined; 13 | this.shardval = undefined; 14 | this.saveError = undefined; 15 | this.validationError = undefined; 16 | this.adhocPaths = undefined; 17 | this.removing = undefined; 18 | this.inserting = undefined; 19 | this.version = undefined; 20 | this.getters = {}; 21 | this._id = undefined; 22 | this.populate = undefined; // what we want to populate in this doc 23 | this.populated = undefined;// the _ids that have been populated 24 | this.wasPopulated = false; // if this doc was the result of a population 25 | this.scope = undefined; 26 | this.activePaths = new ActiveRoster; 27 | 28 | // embedded docs 29 | this.ownerDocument = undefined; 30 | this.fullPath = undefined; 31 | } 32 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/lib/bson/symbol.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A class representation of the BSON Symbol type. 3 | * 4 | * @class Represents the BSON Symbol type. 5 | * @param {String} value the string representing the symbol. 6 | * @return {Symbol} 7 | */ 8 | function Symbol(value) { 9 | if(!(this instanceof Symbol)) return new Symbol(value); 10 | this._bsontype = 'Symbol'; 11 | this.value = value; 12 | } 13 | 14 | /** 15 | * Access the wrapped string value. 16 | * 17 | * @return {String} returns the wrapped string. 18 | * @api public 19 | */ 20 | Symbol.prototype.valueOf = function() { 21 | return this.value; 22 | }; 23 | 24 | /** 25 | * @ignore 26 | * @api private 27 | */ 28 | Symbol.prototype.toString = function() { 29 | return this.value; 30 | } 31 | 32 | /** 33 | * @ignore 34 | * @api private 35 | */ 36 | Symbol.prototype.inspect = function() { 37 | return this.value; 38 | } 39 | 40 | /** 41 | * @ignore 42 | * @api private 43 | */ 44 | Symbol.prototype.toJSON = function() { 45 | return this.value; 46 | } 47 | 48 | exports.Symbol = Symbol; -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/core-util-is/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-util-is", 3 | "version": "1.0.1", 4 | "description": "The `util.is*` functions introduced in Node v0.12.", 5 | "main": "lib/util.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/isaacs/core-util-is" 9 | }, 10 | "keywords": [ 11 | "util", 12 | "isBuffer", 13 | "isArray", 14 | "isNumber", 15 | "isString", 16 | "isRegExp", 17 | "isThis", 18 | "isThat", 19 | "polyfill" 20 | ], 21 | "author": { 22 | "name": "Isaac Z. Schlueter", 23 | "email": "i@izs.me", 24 | "url": "http://blog.izs.me/" 25 | }, 26 | "license": "MIT", 27 | "bugs": { 28 | "url": "https://github.com/isaacs/core-util-is/issues" 29 | }, 30 | "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", 31 | "readmeFilename": "README.md", 32 | "homepage": "https://github.com/isaacs/core-util-is", 33 | "_id": "core-util-is@1.0.1", 34 | "_from": "core-util-is@~1.0.0", 35 | "scripts": {} 36 | } 37 | -------------------------------------------------------------------------------- /lib/error/validator.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Module dependencies. 3 | */ 4 | 5 | var DocoomentError = require('../error.js'); 6 | var errorMessages = DocoomentError.messages; 7 | 8 | /** 9 | * Schema validator error 10 | * 11 | * @param {String} path 12 | * @param {String} msg 13 | * @param {String|Number|any} val 14 | * @inherits DocoomentError 15 | * @api private 16 | */ 17 | 18 | function ValidatorError (path, msg, type, val) { 19 | if (!msg) msg = errorMessages.general.default; 20 | var message = this.formatMessage(msg, path, type, val); 21 | DocoomentError.call(this, message); 22 | Error.captureStackTrace(this, arguments.callee); 23 | this.name = 'ValidatorError'; 24 | this.path = path; 25 | this.type = type; 26 | this.value = val; 27 | }; 28 | 29 | /*! 30 | * toString helper 31 | */ 32 | 33 | ValidatorError.prototype.toString = function () { 34 | return this.message; 35 | } 36 | 37 | /*! 38 | * Inherits from DocoomentError 39 | */ 40 | 41 | ValidatorError.prototype.__proto__ = DocoomentError.prototype; 42 | 43 | /*! 44 | * exports 45 | */ 46 | 47 | module.exports = ValidatorError; 48 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error/validator.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Module dependencies. 3 | */ 4 | 5 | var MongooseError = require('../error.js'); 6 | var errorMessages = MongooseError.messages; 7 | 8 | /** 9 | * Schema validator error 10 | * 11 | * @param {String} path 12 | * @param {String} msg 13 | * @param {String|Number|any} val 14 | * @inherits MongooseError 15 | * @api private 16 | */ 17 | 18 | function ValidatorError (path, msg, type, val) { 19 | if (!msg) msg = errorMessages.general.default; 20 | var message = this.formatMessage(msg, path, type, val); 21 | MongooseError.call(this, message); 22 | Error.captureStackTrace(this, arguments.callee); 23 | this.name = 'ValidatorError'; 24 | this.path = path; 25 | this.type = type; 26 | this.value = val; 27 | }; 28 | 29 | /*! 30 | * toString helper 31 | */ 32 | 33 | ValidatorError.prototype.toString = function () { 34 | return this.message; 35 | } 36 | 37 | /*! 38 | * Inherits from MongooseError 39 | */ 40 | 41 | ValidatorError.prototype.__proto__ = MongooseError.prototype; 42 | 43 | /*! 44 | * exports 45 | */ 46 | 47 | module.exports = ValidatorError; 48 | -------------------------------------------------------------------------------- /lib/error/validation.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module requirements 4 | */ 5 | 6 | var DocoomentError = require('../error.js') 7 | 8 | /** 9 | * Document Validation Error 10 | * 11 | * @api private 12 | * @param {Document} instance 13 | * @inherits DocoomentError 14 | */ 15 | 16 | function ValidationError (instance) { 17 | DocoomentError.call(this, "Validation failed"); 18 | Error.captureStackTrace(this, arguments.callee); 19 | this.name = 'ValidationError'; 20 | this.errors = instance.errors = {}; 21 | }; 22 | 23 | /** 24 | * Console.log helper 25 | */ 26 | 27 | ValidationError.prototype.toString = function () { 28 | var ret = this.name + ': '; 29 | var msgs = []; 30 | 31 | Object.keys(this.errors).forEach(function (key) { 32 | if (this == this.errors[key]) return; 33 | msgs.push(String(this.errors[key])); 34 | }, this) 35 | 36 | return ret + msgs.join(', '); 37 | }; 38 | 39 | /*! 40 | * Inherits from DocoomentError. 41 | */ 42 | 43 | ValidationError.prototype.__proto__ = DocoomentError.prototype; 44 | 45 | /*! 46 | * Module exports 47 | */ 48 | 49 | module.exports = exports = ValidationError; 50 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error/validation.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module requirements 4 | */ 5 | 6 | var MongooseError = require('../error.js') 7 | 8 | /** 9 | * Document Validation Error 10 | * 11 | * @api private 12 | * @param {Document} instance 13 | * @inherits MongooseError 14 | */ 15 | 16 | function ValidationError (instance) { 17 | MongooseError.call(this, "Validation failed"); 18 | Error.captureStackTrace(this, arguments.callee); 19 | this.name = 'ValidationError'; 20 | this.errors = instance.errors = {}; 21 | }; 22 | 23 | /** 24 | * Console.log helper 25 | */ 26 | 27 | ValidationError.prototype.toString = function () { 28 | var ret = this.name + ': '; 29 | var msgs = []; 30 | 31 | Object.keys(this.errors).forEach(function (key) { 32 | if (this == this.errors[key]) return; 33 | msgs.push(String(this.errors[key])); 34 | }, this) 35 | 36 | return ret + msgs.join(', '); 37 | }; 38 | 39 | /*! 40 | * Inherits from MongooseError. 41 | */ 42 | 43 | ValidationError.prototype.__proto__ = MongooseError.prototype; 44 | 45 | /*! 46 | * Module exports 47 | */ 48 | 49 | module.exports = exports = ValidationError; 50 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/globalschemas/gs_example.js: -------------------------------------------------------------------------------- 1 | 2 | var mongoose = require('../../lib'); 3 | 4 | 5 | // import the global schema, this can be done in any file that needs the model 6 | require('./person.js')(); 7 | 8 | // grab the person model object 9 | var Person = mongoose.model("Person"); 10 | 11 | // connect to a server to do a quick write / read example 12 | 13 | mongoose.connect('mongodb://localhost/persons', function(err) { 14 | if (err) throw err; 15 | 16 | Person.create({ 17 | name : 'bill', 18 | age : 25, 19 | birthday : new Date().setFullYear((new Date().getFullYear() - 25)) 20 | }, function (err, bill) { 21 | if (err) throw err; 22 | console.log("People added to db: %s", bill.toString()); 23 | Person.find({}, function(err, people) { 24 | if (err) throw err; 25 | 26 | people.forEach(function(person) { 27 | console.log("People in the db: %s", person.toString()); 28 | }); 29 | 30 | // make sure to clean things up after we're done 31 | setTimeout(function () { cleanup(); }, 2000); 32 | }); 33 | }); 34 | }); 35 | 36 | function cleanup() { 37 | Person.remove(function() { 38 | mongoose.disconnect(); 39 | }); 40 | } 41 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/tools/jasmine-1.1.0/MIT.LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2011 Pivotal Labs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to 4 | deal in the Software without restriction, including without limitation the 5 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 6 | sell copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/lib/mongodb/connection/connection_utils.js: -------------------------------------------------------------------------------- 1 | exports.setIntegerParameter = function(object, field, defaultValue) { 2 | if(object[field] == null) { 3 | object[field] = defaultValue; 4 | } else if(typeof object[field] !== "number" && object[field] !== parseInt(object[field], 10)) { 5 | throw "object field [" + field + "] must be a numeric integer value, attempted to set to [" + object[field] + "] type of [" + typeof object[field] + "]"; 6 | } 7 | } 8 | 9 | exports.setBooleanParameter = function(object, field, defaultValue) { 10 | if(object[field] == null) { 11 | object[field] = defaultValue; 12 | } else if(typeof object[field] !== "boolean") { 13 | throw "object field [" + field + "] must be a boolean value, attempted to set to [" + object[field] + "] type of [" + typeof object[field] + "]"; 14 | } 15 | } 16 | 17 | exports.setStringParameter = function(object, field, defaultValue) { 18 | if(object[field] == null) { 19 | object[field] = defaultValue; 20 | } else if(typeof object[field] !== "string") { 21 | throw "object field [" + field + "] must be a string value, attempted to set to [" + object[field] + "] type of [" + typeof object[field] + "]"; 22 | } 23 | } -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpath/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/muri/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/sliced/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/regexp-clone/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2013 [Aaron Heckmann](aaron.heckmann+github@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/string_decoder/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Joyent, Inc. and other Node contributors. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to permit 8 | persons to whom the Software is furnished to do so, subject to the 9 | following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/test/kerberos_tests.js: -------------------------------------------------------------------------------- 1 | exports.setUp = function(callback) { 2 | callback(); 3 | } 4 | 5 | exports.tearDown = function(callback) { 6 | callback(); 7 | } 8 | 9 | exports['Simple initialize of Kerberos object'] = function(test) { 10 | var Kerberos = require('../lib/kerberos.js').Kerberos; 11 | var kerberos = new Kerberos(); 12 | // console.dir(kerberos) 13 | 14 | // Initiate kerberos client 15 | kerberos.authGSSClientInit('mongodb@kdc.10gen.me', Kerberos.GSS_C_MUTUAL_FLAG, function(err, context) { 16 | console.log("===================================== authGSSClientInit") 17 | test.equal(null, err); 18 | test.ok(context != null && typeof context == 'object'); 19 | // console.log("===================================== authGSSClientInit") 20 | console.dir(err) 21 | console.dir(context) 22 | // console.dir(typeof result) 23 | 24 | // Perform the first step 25 | kerberos.authGSSClientStep(context, function(err, result) { 26 | console.log("===================================== authGSSClientStep") 27 | console.dir(err) 28 | console.dir(result) 29 | console.dir(context) 30 | 31 | test.done(); 32 | }); 33 | }); 34 | } -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/build/kerberos.target.mk: -------------------------------------------------------------------------------- 1 | # This file is generated by gyp; do not edit. 2 | 3 | TOOLSET := target 4 | TARGET := kerberos 5 | ### Rules for final target. 6 | LDFLAGS_Debug := \ 7 | -pthread \ 8 | -rdynamic \ 9 | -m64 10 | 11 | LDFLAGS_Release := \ 12 | -pthread \ 13 | -rdynamic \ 14 | -m64 15 | 16 | LIBS := 17 | 18 | $(obj).target/kerberos.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) 19 | $(obj).target/kerberos.node: LIBS := $(LIBS) 20 | $(obj).target/kerberos.node: TOOLSET := $(TOOLSET) 21 | $(obj).target/kerberos.node: FORCE_DO_CMD 22 | $(call do_cmd,solink_module) 23 | 24 | all_deps += $(obj).target/kerberos.node 25 | # Add target alias 26 | .PHONY: kerberos 27 | kerberos: $(builddir)/kerberos.node 28 | 29 | # Copy this to the executable output path. 30 | $(builddir)/kerberos.node: TOOLSET := $(TOOLSET) 31 | $(builddir)/kerberos.node: $(obj).target/kerberos.node FORCE_DO_CMD 32 | $(call do_cmd,copy) 33 | 34 | all_deps += $(builddir)/kerberos.node 35 | # Short alias for building this executable. 36 | .PHONY: kerberos.node 37 | kerberos.node: $(obj).target/kerberos.node $(builddir)/kerberos.node 38 | 39 | # Add executable to "all" target. 40 | .PHONY: all 41 | all: $(builddir)/kerberos.node 42 | 43 | -------------------------------------------------------------------------------- /lib/error/divergentArray.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var DocoomentError = require('../error.js'); 7 | 8 | /*! 9 | * DivergentArrayError constructor. 10 | * 11 | * @inherits DocoomentError 12 | */ 13 | 14 | function DivergentArrayError (paths) { 15 | var msg = 'For your own good, using `document.save()` to update an array ' 16 | + 'which was selected using an $elemMatch projection OR ' 17 | + 'populated using skip, limit, query conditions, or exclusion of ' 18 | + 'the _id field when the operation results in a $pop or $set of ' 19 | + 'the entire array is not supported. The following ' 20 | + 'path(s) would have been modified unsafely:\n' 21 | + ' ' + paths.join('\n ') + '\n' 22 | + 'Use Model.update() to update these arrays instead.' 23 | // TODO write up a docs page (FAQ) and link to it 24 | 25 | DocoomentError.call(this, msg); 26 | Error.captureStackTrace(this, arguments.callee); 27 | this.name = 'DivergentArrayError'; 28 | }; 29 | 30 | /*! 31 | * Inherits from DocoomentError. 32 | */ 33 | 34 | DivergentArrayError.prototype.__proto__ = DocoomentError.prototype; 35 | 36 | /*! 37 | * exports 38 | */ 39 | 40 | module.exports = DivergentArrayError; 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docooment", 3 | "description": "A Mongoose like Azure DocuomentDB ORM.", 4 | "version": "0.5.3", 5 | "main": "index.js", 6 | "dependencies": { 7 | "async": "^0.9.0", 8 | "bson": "^0.2.16", 9 | "documentdb": "^1.7.0", 10 | "hooks": "^0.3.2", 11 | "sliced": "0.0.5", 12 | "underscore": "^1.7.0", 13 | "mpath": "^0.2.1", 14 | "mpromise": "^0.5.5", 15 | "mquery": "^1.3.0" 16 | }, 17 | "engines": { 18 | "node": ">=0.10.0" 19 | }, 20 | "private": false, 21 | "devDependencies": {}, 22 | "repository": { 23 | "type": "git", 24 | "url": "https://github.com/gian788/docooment.git" 25 | }, 26 | "author": { 27 | "name": "Gianluca Pengo", 28 | "email": "gianluca.pengo@gmail.com" 29 | }, 30 | "keywords": [ 31 | "DocumentDb", 32 | "document", 33 | "model", 34 | "schema", 35 | "database", 36 | "odm", 37 | "data", 38 | "datastore", 39 | "query", 40 | "nosql", 41 | "orm", 42 | "db", 43 | "azure", 44 | "mongoose" 45 | ], 46 | "license": "MIT", 47 | "bugs": { 48 | "url": "https://github.com/gian788/docooment/issues" 49 | }, 50 | "homepage": "https://github.com/gian788/docooment", 51 | "readmeFilename": "README.md" 52 | } 53 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error/divergentArray.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var MongooseError = require('../error.js'); 7 | 8 | /*! 9 | * DivergentArrayError constructor. 10 | * 11 | * @inherits MongooseError 12 | */ 13 | 14 | function DivergentArrayError (paths) { 15 | var msg = 'For your own good, using `document.save()` to update an array ' 16 | + 'which was selected using an $elemMatch projection OR ' 17 | + 'populated using skip, limit, query conditions, or exclusion of ' 18 | + 'the _id field when the operation results in a $pop or $set of ' 19 | + 'the entire array is not supported. The following ' 20 | + 'path(s) would have been modified unsafely:\n' 21 | + ' ' + paths.join('\n ') + '\n' 22 | + 'Use Model.update() to update these arrays instead.' 23 | // TODO write up a docs page (FAQ) and link to it 24 | 25 | MongooseError.call(this, msg); 26 | Error.captureStackTrace(this, arguments.callee); 27 | this.name = 'DivergentArrayError'; 28 | }; 29 | 30 | /*! 31 | * Inherits from MongooseError. 32 | */ 33 | 34 | DivergentArrayError.prototype.__proto__ = MongooseError.prototype; 35 | 36 | /*! 37 | * exports 38 | */ 39 | 40 | module.exports = DivergentArrayError; 41 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/README.md: -------------------------------------------------------------------------------- 1 | This directory contains runnable sample mongoose programs. 2 | 3 | To run: 4 | 5 | - first install [Node.js](http://nodejs.org/) 6 | - from the root of the project, execute `npm install -d` 7 | - in the example directory, run `npm install -d` 8 | - from the command line, execute: `node example.js`, replacing "example.js" with the name of a program. 9 | 10 | 11 | Goal is to show: 12 | 13 | - ~~global schemas~~ 14 | - ~~GeoJSON schemas / use (with crs)~~ 15 | - text search (once MongoDB removes the "Experimental/beta" label) 16 | - ~~lean queries~~ 17 | - ~~statics~~ 18 | - methods and statics on subdocs 19 | - custom types 20 | - ~~querybuilder~~ 21 | - ~~promises~~ 22 | - accessing driver collection, db 23 | - ~~connecting to replica sets~~ 24 | - connecting to sharded clusters 25 | - enabling a fail fast mode 26 | - on the fly schemas 27 | - storing files 28 | - ~~map reduce~~ 29 | - ~~aggregation~~ 30 | - advanced hooks 31 | - using $elemMatch to return a subset of an array 32 | - query casting 33 | - upserts 34 | - pagination 35 | - express + mongoose session handling 36 | - ~~group by (use aggregation)~~ 37 | - authentication 38 | - schema migration techniques 39 | - converting documents to plain objects (show transforms) 40 | - how to $unset 41 | 42 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/kerberos_context.h: -------------------------------------------------------------------------------- 1 | #ifndef KERBEROS_CONTEXT_H 2 | #define KERBEROS_CONTEXT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | extern "C" { 13 | #include "kerberosgss.h" 14 | } 15 | 16 | using namespace v8; 17 | using namespace node; 18 | 19 | class KerberosContext : public ObjectWrap { 20 | 21 | public: 22 | KerberosContext(); 23 | ~KerberosContext(); 24 | 25 | static inline bool HasInstance(Handle val) { 26 | if (!val->IsObject()) return false; 27 | Local obj = val->ToObject(); 28 | return constructor_template->HasInstance(obj); 29 | }; 30 | 31 | // Constructor used for creating new Kerberos objects from C++ 32 | static Persistent constructor_template; 33 | 34 | // Initialize function for the object 35 | static void Initialize(Handle target); 36 | 37 | // Public constructor 38 | static KerberosContext* New(); 39 | 40 | // Handle to the kerberos context 41 | gss_client_state *state; 42 | 43 | private: 44 | static Handle New(const Arguments &args); 45 | 46 | static Handle ResponseGetter(Local property, const AccessorInfo& info); 47 | }; 48 | #endif -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'kerberos', 5 | 'cflags!': [ '-fno-exceptions' ], 6 | 'cflags_cc!': [ '-fno-exceptions' ], 7 | 'conditions': [ 8 | ['OS=="mac"', { 9 | 'sources': [ 'lib/kerberos.cc', 'lib/worker.cc', 'lib/kerberosgss.c', 'lib/base64.c', 'lib/kerberos_context.cc' ], 10 | 'defines': [ 11 | '__MACOSX_CORE__' 12 | ], 13 | 'xcode_settings': { 14 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' 15 | }, 16 | "link_settings": { 17 | "libraries": [ 18 | "-lkrb5" 19 | ] 20 | } 21 | }], 22 | ['OS=="win"', { 23 | 'sources': [ 24 | 'lib/win32/kerberos.cc', 25 | 'lib/win32/base64.c', 26 | 'lib/win32/worker.cc', 27 | 'lib/win32/kerberos_sspi.c', 28 | 'lib/win32/wrappers/security_buffer.cc', 29 | 'lib/win32/wrappers/security_buffer_descriptor.cc', 30 | 'lib/win32/wrappers/security_context.cc', 31 | 'lib/win32/wrappers/security_credentials.cc' 32 | ], 33 | "link_settings": { 34 | "libraries": [ 35 | ] 36 | } 37 | }] 38 | ] 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/ext/wscript: -------------------------------------------------------------------------------- 1 | import Options 2 | from os import unlink, symlink, popen 3 | from os.path import exists 4 | 5 | srcdir = "." 6 | blddir = "build" 7 | VERSION = "0.1.0" 8 | 9 | def set_options(opt): 10 | opt.tool_options("compiler_cxx") 11 | opt.add_option( '--debug' 12 | , action='store_true' 13 | , default=False 14 | , help='Build debug variant [Default: False]' 15 | , dest='debug' 16 | ) 17 | 18 | def configure(conf): 19 | conf.check_tool("compiler_cxx") 20 | conf.check_tool("node_addon") 21 | conf.env.append_value('CXXFLAGS', ['-O3', '-funroll-loops']) 22 | 23 | # conf.env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra']) 24 | # conf.check(lib='node', libpath=['/usr/lib', '/usr/local/lib'], uselib_store='NODE') 25 | 26 | def build(bld): 27 | obj = bld.new_task_gen("cxx", "shlib", "node_addon") 28 | obj.target = "bson" 29 | obj.source = ["bson.cc"] 30 | # obj.uselib = "NODE" 31 | 32 | def shutdown(): 33 | # HACK to get compress.node out of build directory. 34 | # better way to do this? 35 | if Options.commands['clean']: 36 | if exists('bson.node'): unlink('bson.node') 37 | else: 38 | if exists('build/default/bson.node') and not exists('bson.node'): 39 | symlink('build/default/bson.node', 'bson.node') 40 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/wrappers/security_buffer_descriptor.h: -------------------------------------------------------------------------------- 1 | #ifndef SECURITY_BUFFER_DESCRIPTOR_H 2 | #define SECURITY_BUFFER_DESCRIPTOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | using namespace v8; 12 | using namespace node; 13 | 14 | class SecurityBufferDescriptor : public ObjectWrap { 15 | public: 16 | Persistent arrayObject; 17 | SecBufferDesc secBufferDesc; 18 | 19 | SecurityBufferDescriptor(); 20 | SecurityBufferDescriptor(Persistent arrayObject); 21 | ~SecurityBufferDescriptor(); 22 | 23 | // Has instance check 24 | static inline bool HasInstance(Handle val) { 25 | if (!val->IsObject()) return false; 26 | Local obj = val->ToObject(); 27 | return constructor_template->HasInstance(obj); 28 | }; 29 | 30 | char *toBuffer(); 31 | size_t bufferSize(); 32 | 33 | // Functions available from V8 34 | static void Initialize(Handle target); 35 | static Handle ToBuffer(const Arguments &args); 36 | 37 | // Constructor used for creating new Long objects from C++ 38 | static Persistent constructor_template; 39 | 40 | private: 41 | static Handle New(const Arguments &args); 42 | }; 43 | 44 | #endif -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/wrappers/security_buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef SECURITY_BUFFER_H 2 | #define SECURITY_BUFFER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define SECURITY_WIN32 1 9 | 10 | #include 11 | #include 12 | 13 | using namespace v8; 14 | using namespace node; 15 | 16 | class SecurityBuffer : public ObjectWrap { 17 | public: 18 | SecurityBuffer(uint32_t security_type, size_t size); 19 | SecurityBuffer(uint32_t security_type, size_t size, void *data); 20 | ~SecurityBuffer(); 21 | 22 | // Internal values 23 | void *data; 24 | size_t size; 25 | uint32_t security_type; 26 | SecBuffer sec_buffer; 27 | 28 | // Has instance check 29 | static inline bool HasInstance(Handle val) { 30 | if (!val->IsObject()) return false; 31 | Local obj = val->ToObject(); 32 | return constructor_template->HasInstance(obj); 33 | }; 34 | 35 | // Functions available from V8 36 | static void Initialize(Handle target); 37 | static Handle ToBuffer(const Arguments &args); 38 | 39 | // Constructor used for creating new Long objects from C++ 40 | static Persistent constructor_template; 41 | 42 | private: 43 | static Handle New(const Arguments &args); 44 | }; 45 | 46 | #endif -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/README.md: -------------------------------------------------------------------------------- 1 | # readable-stream 2 | 3 | ***Node-core streams for userland*** 4 | 5 | [![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) 6 | [![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) 7 | 8 | This package is a mirror of the Streams2 and Streams3 implementations in Node-core. 9 | 10 | If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core. 11 | 12 | **readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. 13 | 14 | **readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` 15 | 16 | -------------------------------------------------------------------------------- /lib/docoomentdb/README.md: -------------------------------------------------------------------------------- 1 | # DocoomentDb 2 | 3 | DocoomentDb is a [DocumentDb](http://www.documentdb.azure.com/) object modeling tool designed to work in an asynchronous environment, in a way like [Mongoose](http://mongoosejs.com/). 4 | 5 | ## License 6 | 7 | Copyright (c) 2015 Digital Rockers srl <dev@digitalrockers.it> 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining 10 | a copy of this software and associated documentation files (the 11 | 'Software'), to deal in the Software without restriction, including 12 | without limitation the rights to use, copy, modify, merge, publish, 13 | distribute, sublicense, and/or sell copies of the Software, and to 14 | permit persons to whom the Software is furnished to do so, subject to 15 | the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be 18 | included in all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/kerberos.h: -------------------------------------------------------------------------------- 1 | #ifndef KERBEROS_H 2 | #define KERBEROS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "util.h" 13 | 14 | extern "C" { 15 | #include "kerberosgss.h" 16 | } 17 | 18 | using namespace v8; 19 | using namespace node; 20 | 21 | class Kerberos : public ObjectWrap { 22 | 23 | public: 24 | Kerberos(); 25 | ~Kerberos() {}; 26 | 27 | // Constructor used for creating new Kerberos objects from C++ 28 | static Persistent constructor_template; 29 | 30 | // Initialize function for the object 31 | static void Initialize(Handle target); 32 | 33 | // Method available 34 | static Handle AuthGSSClientInit(const Arguments &args); 35 | static Handle AuthGSSClientStep(const Arguments &args); 36 | static Handle AuthGSSClientUnwrap(const Arguments &args); 37 | static Handle AuthGSSClientWrap(const Arguments &args); 38 | static Handle AuthGSSClientClean(const Arguments &args); 39 | 40 | private: 41 | static Handle New(const Arguments &args); 42 | 43 | // Handles the uv calls 44 | static void Process(uv_work_t* work_req); 45 | // Called after work is done 46 | static void After(uv_work_t* work_req); 47 | }; 48 | 49 | #endif -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/string_decoder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "string_decoder", 3 | "version": "0.10.31", 4 | "description": "The string_decoder module from Node core", 5 | "main": "index.js", 6 | "dependencies": {}, 7 | "devDependencies": { 8 | "tap": "~0.4.8" 9 | }, 10 | "scripts": { 11 | "test": "tap test/simple/*.js" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/rvagg/string_decoder.git" 16 | }, 17 | "homepage": "https://github.com/rvagg/string_decoder", 18 | "keywords": [ 19 | "string", 20 | "decoder", 21 | "browser", 22 | "browserify" 23 | ], 24 | "license": "MIT", 25 | "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.", 26 | "readmeFilename": "README.md", 27 | "bugs": { 28 | "url": "https://github.com/rvagg/string_decoder/issues" 29 | }, 30 | "_id": "string_decoder@0.10.31", 31 | "_from": "string_decoder@~0.10.x" 32 | } 33 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/.idea/codeStyleSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/ms/test/test.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Dependencies. 4 | */ 5 | 6 | if ('undefined' != typeof require) { 7 | expect = require('expect.js'); 8 | ms = require('../ms'); 9 | } 10 | 11 | /** 12 | * Test. 13 | */ 14 | 15 | describe('ms.js', function () { 16 | 17 | it('should preserve ms', function () { 18 | expect(100).to.be(100); 19 | }); 20 | 21 | it('should convert number strings to number', function () { 22 | expect(ms('1e+5')).to.be(1e+5); 23 | }); 24 | 25 | it('should convert from m to ms', function () { 26 | expect(ms('1m')).to.be(60000); 27 | }); 28 | 29 | it('should convert from h to ms', function () { 30 | expect(ms('1h')).to.be(3600000); 31 | }); 32 | 33 | it('should convert d to ms', function () { 34 | expect(ms('2d')).to.be(172800000); 35 | }); 36 | 37 | it('should convert s to ms', function () { 38 | expect(ms('1s')).to.be(1000); 39 | }); 40 | 41 | it('should convert ms to ms', function () { 42 | expect(ms('100ms')).to.be(100); 43 | }); 44 | 45 | it('should work with decimals', function () { 46 | expect(ms('1.5h')).to.be(5400000); 47 | }); 48 | 49 | it('should return NaN if invalid', function () { 50 | expect(isNaN(ms('☃'))).to.be(true); 51 | }); 52 | 53 | it('should be case-insensitive', function () { 54 | expect(ms('1.5H')).to.be(5400000); 55 | }); 56 | 57 | it('should work with numbers starting with .', function () { 58 | expect(ms('.5ms')).to.be(.5); 59 | }); 60 | 61 | }); 62 | -------------------------------------------------------------------------------- /lib/error/messages.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * The default built-in validator error messages. These may be customized. 4 | * 5 | * // customize within each schema or globally like so 6 | * var docooment = require('docooment'); 7 | * docooment.Error.messages.String.enum = "Your custom message for {PATH}."; 8 | * 9 | * As you might have noticed, error messages support basic templating 10 | * 11 | * - `{PATH}` is replaced with the invalid document path 12 | * - `{VALUE}` is replaced with the invalid value 13 | * - `{TYPE}` is replaced with the validator type such as "regexp", "min", or "user defined" 14 | * - `{MIN}` is replaced with the declared min value for the Number.min validator 15 | * - `{MAX}` is replaced with the declared max value for the Number.max validator 16 | * 17 | * Click the "show code" link below to see all defaults. 18 | * 19 | * @property messages 20 | * @receiver MongooseError 21 | * @api public 22 | */ 23 | 24 | var msg = module.exports = exports = {}; 25 | 26 | msg.general = {}; 27 | msg.general.default = "Validator failed for path `{PATH}` with value `{VALUE}`"; 28 | msg.general.required = "Path `{PATH}` is required."; 29 | 30 | msg.Number = {}; 31 | msg.Number.min = "Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN})."; 32 | msg.Number.max = "Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX})."; 33 | 34 | msg.String = {}; 35 | msg.String.enum = "`{VALUE}` is not a valid enum value for path `{PATH}`."; 36 | msg.String.match = "Path `{PATH}` is invalid ({VALUE})."; 37 | 38 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error/messages.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * The default built-in validator error messages. These may be customized. 4 | * 5 | * // customize within each schema or globally like so 6 | * var mongoose = require('mongoose'); 7 | * mongoose.Error.messages.String.enum = "Your custom message for {PATH}."; 8 | * 9 | * As you might have noticed, error messages support basic templating 10 | * 11 | * - `{PATH}` is replaced with the invalid document path 12 | * - `{VALUE}` is replaced with the invalid value 13 | * - `{TYPE}` is replaced with the validator type such as "regexp", "min", or "user defined" 14 | * - `{MIN}` is replaced with the declared min value for the Number.min validator 15 | * - `{MAX}` is replaced with the declared max value for the Number.max validator 16 | * 17 | * Click the "show code" link below to see all defaults. 18 | * 19 | * @property messages 20 | * @receiver MongooseError 21 | * @api public 22 | */ 23 | 24 | var msg = module.exports = exports = {}; 25 | 26 | msg.general = {}; 27 | msg.general.default = "Validator failed for path `{PATH}` with value `{VALUE}`"; 28 | msg.general.required = "Path `{PATH}` is required."; 29 | 30 | msg.Number = {}; 31 | msg.Number.min = "Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN})."; 32 | msg.Number.max = "Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX})."; 33 | 34 | msg.String = {}; 35 | msg.String.enum = "`{VALUE}` is not a valid enum value for path `{PATH}`."; 36 | msg.String.match = "Path `{PATH}` is invalid ({VALUE})."; 37 | 38 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mpromise/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.4.3 / 2013-12-17 3 | ================== 4 | 5 | * fixed; non-A+ behavior on fulfill and reject [lbeschastny](https://github.com/lbeschastny) 6 | * tests; simplified harness + compatible with travis + compatible with windows 7 | 8 | 0.4.2 / 2013-11-26 9 | ================== 10 | 11 | * fixed; enter the domain only if not the present domain 12 | * added; `end` returns the promise 13 | 14 | 0.4.1 / 2013-10-26 15 | ================== 16 | 17 | * Add `all` 18 | * Longjohn for easier debugging 19 | * can end a promise chain with an error handler 20 | * Add ```chain``` 21 | 22 | 0.4.0 / 2013-10-24 23 | ================== 24 | 25 | * fixed; now plays nice with domains #3 [refack](https://github.com/refack) 26 | * updated; compatibility for Promises A+ 2.0.0 [refack](https://github.com/refack) 27 | * updated; guard against invalid arguments [refack](https://github.com/refack) 28 | 29 | 0.3.0 / 2013-07-25 30 | ================== 31 | 32 | * updated; sliced to 0.0.5 33 | * fixed; then is passed all fulfillment values 34 | * use setImmediate if available 35 | * conform to Promises A+ 1.1 36 | 37 | 0.2.1 / 2013-02-09 38 | ================== 39 | 40 | * fixed; conformancy with A+ 1.2 41 | 42 | 0.2.0 / 2013-01-09 43 | ================== 44 | 45 | * added; .end() 46 | * fixed; only catch handler executions 47 | 48 | 0.1.0 / 2013-01-08 49 | ================== 50 | 51 | * cleaned up API 52 | * customizable event names 53 | * docs 54 | 55 | 0.0.1 / 2013-01-07 56 | ================== 57 | 58 | * original release 59 | 60 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/doc-methods.js: -------------------------------------------------------------------------------- 1 | 2 | var mongoose = require('mongoose') 3 | var Schema = mongoose.Schema; 4 | 5 | console.log('Running mongoose version %s', mongoose.version); 6 | 7 | /** 8 | * Schema 9 | */ 10 | 11 | var CharacterSchema = Schema({ 12 | name: { type: String, required: true } 13 | , health: { type: Number, min: 0, max: 100 } 14 | }) 15 | 16 | /** 17 | * Methods 18 | */ 19 | 20 | CharacterSchema.methods.attack = function () { 21 | console.log('%s is attacking', this.name); 22 | } 23 | 24 | /** 25 | * Character model 26 | */ 27 | 28 | var Character = mongoose.model('Character', CharacterSchema); 29 | 30 | /** 31 | * Connect to the database on localhost with 32 | * the default port (27017) 33 | */ 34 | 35 | var dbname = 'mongoose-example-doc-methods-' + ((Math.random()*10000)|0); 36 | var uri = 'mongodb://localhost/' + dbname; 37 | 38 | console.log('connecting to %s', uri); 39 | 40 | mongoose.connect(uri, function (err) { 41 | // if we failed to connect, abort 42 | if (err) throw err; 43 | 44 | // we connected ok 45 | example(); 46 | }) 47 | 48 | /** 49 | * Use case 50 | */ 51 | 52 | function example () { 53 | Character.create({ name: 'Link', health: 100 }, function (err, link) { 54 | if (err) return done(err); 55 | console.log('found', link); 56 | link.attack(); // 'Link is attacking' 57 | done(); 58 | }) 59 | } 60 | 61 | /** 62 | * Clean up 63 | */ 64 | 65 | function done (err) { 66 | if (err) console.error(err); 67 | mongoose.connection.db.dropDatabase(function () { 68 | mongoose.disconnect(); 69 | }) 70 | } 71 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kerberos", 3 | "version": "0.0.4", 4 | "description": "Kerberos library for Node.js", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/christkv/kerberos.git" 9 | }, 10 | "keywords": [ 11 | "kerberos", 12 | "security", 13 | "authentication" 14 | ], 15 | "devDependencies": { 16 | "nodeunit": "latest" 17 | }, 18 | "scripts": { 19 | "install": "(node-gyp rebuild 2> builderror.log) || (exit 0)", 20 | "test": "nodeunit ./test" 21 | }, 22 | "author": { 23 | "name": "Christian Amor Kvalheim" 24 | }, 25 | "license": "Apache 2.0", 26 | "gitHead": "bb01d4fe322e022999aca19da564e7d9db59a8ed", 27 | "bugs": { 28 | "url": "https://github.com/christkv/kerberos/issues" 29 | }, 30 | "homepage": "https://github.com/christkv/kerberos", 31 | "_id": "kerberos@0.0.4", 32 | "dist": { 33 | "shasum": "11836638f729a2f6c5bae056a7d7a15898c9ba7c", 34 | "tarball": "http://registry.npmjs.org/kerberos/-/kerberos-0.0.4.tgz" 35 | }, 36 | "_from": "kerberos@0.0.4", 37 | "_npmVersion": "1.4.3", 38 | "_npmUser": { 39 | "name": "christkv", 40 | "email": "christkv@gmail.com" 41 | }, 42 | "maintainers": [ 43 | { 44 | "name": "christkv", 45 | "email": "christkv@gmail.com" 46 | } 47 | ], 48 | "directories": {}, 49 | "_shasum": "11836638f729a2f6c5bae056a7d7a15898c9ba7c", 50 | "_resolved": "https://registry.npmjs.org/kerberos/-/kerberos-0.0.4.tgz", 51 | "readme": "ERROR: No README data found!" 52 | } 53 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/muri/README.md: -------------------------------------------------------------------------------- 1 | #Meet Muri! 2 | 3 | Muri is your friendly neighborhood [MongoDB URI](http://www.mongodb.org/display/DOCS/Connections) parser for Node.js. 4 | 5 | 6 | ###Install 7 | 8 | $ npm install muri 9 | 10 | ###Use 11 | 12 | ```js 13 | var muri = require('muri'); 14 | var o = muri('mongodb://user:pass@local,remote:27018,japan:27019/neatdb?replicaSet=myreplset&journal=true&w=2&wtimeoutMS=50'); 15 | 16 | console.log(o); 17 | 18 | { hosts: [ { host: 'local', port: 27017 }, 19 | { host: 'remote', port: 27018 }, 20 | { host: 'japan', port: 27019 } ], 21 | db: 'neatdb', 22 | options: { 23 | replicaSet: 'myreplset', 24 | journal: true, 25 | w: 2, 26 | wtimeoutMS: 50 27 | }, 28 | auth: { 29 | user: 'user', 30 | pass: 'pass' 31 | } 32 | } 33 | ``` 34 | 35 | ### Details 36 | 37 | The returned object contains the following properties: 38 | 39 | - db: the name of the database. defaults to "admin" if not specified 40 | - auth: if auth is specified, this object will exist `{ user: 'username', pass: 'password' }` 41 | - hosts: array of host/port objects, one for each specified `[{ host: 'local', port: 27107 }, { host: '..', port: port }]` 42 | - if a port is not specified for a given host, the default port (27017) is used 43 | - if a unix domain socket is passed, host/port will be undefined and `ipc` will be set to the value specified `[{ ipc: '/tmp/mongodb-27017' }]` 44 | - options: this is a hash of all options specified in the querystring 45 | 46 | [LICENSE](https://github.com/aheckmann/muri/blob/master/LICENSE) 47 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/geospatial/geoJSONexample.js: -------------------------------------------------------------------------------- 1 | 2 | // import async to make control flow simplier 3 | var async = require('async'); 4 | 5 | // import the rest of the normal stuff 6 | var mongoose = require('../../lib'); 7 | 8 | require('./geoJSONSchema.js')(); 9 | 10 | var Location = mongoose.model('Location'); 11 | 12 | // define some dummy data 13 | // note: the type can be Point, LineString, or Polygon 14 | var data = [ 15 | { loc: { type: 'Point', coordinates: [-20.0, 5.0] }}, 16 | { loc: { type: 'Point', coordinates: [6.0, 10.0] }}, 17 | { loc: { type: 'Point', coordinates: [34.0, -50.0] }}, 18 | { loc: { type: 'Point', coordinates: [-100.0, 70.0] }}, 19 | { loc: { type: 'Point', coordinates: [38.0, 38.0] }} 20 | ]; 21 | 22 | 23 | mongoose.connect('mongodb://localhost/locations', function (err) { 24 | if (err) throw err; 25 | 26 | Location.on('index', function(err) { 27 | if (err) throw err; 28 | // create all of the dummy locations 29 | async.each(data, function (item, cb) { 30 | Location.create(item, cb); 31 | }, function (err) { 32 | if (err) throw err; 33 | // create the location we want to search for 34 | var coords = { type : 'Point', coordinates : [-5, 5] }; 35 | // search for it 36 | Location.find({ loc : { $near : coords }}).limit(1).exec(function(err, res) { 37 | if (err) throw err; 38 | console.log("Closest to %s is %s", JSON.stringify(coords), res); 39 | cleanup(); 40 | }); 41 | }); 42 | }); 43 | }); 44 | 45 | function cleanup() { 46 | Location.remove(function() { 47 | mongoose.disconnect(); 48 | }); 49 | } 50 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/ext/index.js: -------------------------------------------------------------------------------- 1 | var bson = null; 2 | 3 | try { 4 | // Load the precompiled win32 binary 5 | if(process.platform == "win32" && process.arch == "x64") { 6 | bson = require('./win32/x64/bson'); 7 | } else if(process.platform == "win32" && process.arch == "ia32") { 8 | bson = require('./win32/ia32/bson'); 9 | } else { 10 | bson = require('../build/Release/bson'); 11 | } 12 | } catch(err) { 13 | // Attempt to load the release bson version 14 | try { 15 | bson = require('../build/Release/bson'); 16 | } catch (err) { 17 | console.error("js-bson: Failed to load c++ bson extension, using pure JS version"); 18 | bson = require('../lib/bson/bson'); 19 | } 20 | } 21 | 22 | exports.BSON = bson.BSON; 23 | exports.Long = require('../lib/bson/long').Long; 24 | exports.ObjectID = require('../lib/bson/objectid').ObjectID; 25 | exports.DBRef = require('../lib/bson/db_ref').DBRef; 26 | exports.Code = require('../lib/bson/code').Code; 27 | exports.Timestamp = require('../lib/bson/timestamp').Timestamp; 28 | exports.Binary = require('../lib/bson/binary').Binary; 29 | exports.Double = require('../lib/bson/double').Double; 30 | exports.MaxKey = require('../lib/bson/max_key').MaxKey; 31 | exports.MinKey = require('../lib/bson/min_key').MinKey; 32 | exports.Symbol = require('../lib/bson/symbol').Symbol; 33 | 34 | // Just add constants tot he Native BSON parser 35 | exports.BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0; 36 | exports.BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1; 37 | exports.BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; 38 | exports.BSON.BSON_BINARY_SUBTYPE_UUID = 3; 39 | exports.BSON.BSON_BINARY_SUBTYPE_MD5 = 4; 40 | exports.BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128; 41 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/kerberos.h: -------------------------------------------------------------------------------- 1 | #ifndef KERBEROS_H 2 | #define KERBEROS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | extern "C" { 9 | #include "kerberos_sspi.h" 10 | #include "base64.h" 11 | } 12 | 13 | using namespace v8; 14 | using namespace node; 15 | 16 | class Kerberos : public ObjectWrap { 17 | 18 | public: 19 | Kerberos(); 20 | ~Kerberos() {}; 21 | 22 | // Constructor used for creating new Kerberos objects from C++ 23 | static Persistent constructor_template; 24 | 25 | // Initialize function for the object 26 | static void Initialize(Handle target); 27 | 28 | // Method available 29 | static Handle AcquireAlternateCredentials(const Arguments &args); 30 | static Handle PrepareOutboundPackage(const Arguments &args); 31 | static Handle DecryptMessage(const Arguments &args); 32 | static Handle EncryptMessage(const Arguments &args); 33 | static Handle QueryContextAttributes(const Arguments &args); 34 | 35 | private: 36 | static Handle New(const Arguments &args); 37 | 38 | // Pointer to context object 39 | SEC_WINNT_AUTH_IDENTITY m_Identity; 40 | // credentials 41 | CredHandle m_Credentials; 42 | // Expiry time for ticket 43 | TimeStamp Expiration; 44 | // package info 45 | SecPkgInfo m_PkgInfo; 46 | // context 47 | CtxtHandle m_Context; 48 | // Do we have a context 49 | bool m_HaveContext; 50 | // Attributes 51 | DWORD CtxtAttr; 52 | 53 | // Handles the uv calls 54 | static void Process(uv_work_t* work_req); 55 | // Called after work is done 56 | static void After(uv_work_t* work_req); 57 | }; 58 | 59 | #endif -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/lib/mongodb/connection/server_capabilities.js: -------------------------------------------------------------------------------- 1 | var ServerCapabilities = function(isMasterResult) { 2 | // Capabilities 3 | var aggregationCursor = false; 4 | var writeCommands = false; 5 | var textSearch = false; 6 | var authCommands = false; 7 | var maxNumberOfDocsInBatch = isMasterResult.maxWriteBatchSize || 1000; 8 | 9 | if(isMasterResult.minWireVersion >= 0) { 10 | textSearch = true; 11 | } 12 | 13 | if(isMasterResult.maxWireVersion >= 1) { 14 | aggregationCursor = true; 15 | authCommands = true; 16 | } 17 | 18 | if(isMasterResult.maxWireVersion >= 2) { 19 | writeCommands = true; 20 | } 21 | 22 | // If no min or max wire version set to 0 23 | if(isMasterResult.minWireVersion == null) { 24 | isMasterResult.minWireVersion = 0; 25 | } 26 | 27 | if(isMasterResult.maxWireVersion == null) { 28 | isMasterResult.maxWireVersion = 0; 29 | } 30 | 31 | // Map up read only parameters 32 | setup_get_property(this, "hasAggregationCursor", aggregationCursor); 33 | setup_get_property(this, "hasWriteCommands", writeCommands); 34 | setup_get_property(this, "hasTextSearch", textSearch); 35 | setup_get_property(this, "hasAuthCommands", authCommands); 36 | setup_get_property(this, "minWireVersion", isMasterResult.minWireVersion); 37 | setup_get_property(this, "maxWireVersion", isMasterResult.maxWireVersion); 38 | setup_get_property(this, "maxNumberOfDocsInBatch", maxNumberOfDocsInBatch); 39 | } 40 | 41 | var setup_get_property = function(object, name, value) { 42 | Object.defineProperty(object, name, { 43 | enumerable: true 44 | , get: function () { return value; } 45 | }); 46 | } 47 | 48 | exports.ServerCapabilities = ServerCapabilities; -------------------------------------------------------------------------------- /lib/docoomentdb/examples/replicasets/replica-sets.js: -------------------------------------------------------------------------------- 1 | 2 | // import async to make control flow simplier 3 | var async = require('async'); 4 | 5 | // import the rest of the normal stuff 6 | var mongoose = require('../../lib'); 7 | 8 | require('./person.js')(); 9 | 10 | var Person = mongoose.model('Person'); 11 | 12 | // define some dummy data 13 | var data = [ 14 | { name : 'bill', age : 25, birthday : new Date().setFullYear((new 15 | Date().getFullYear() - 25)) }, 16 | { name : 'mary', age : 30, birthday : new Date().setFullYear((new 17 | Date().getFullYear() - 30)) }, 18 | { name : 'bob', age : 21, birthday : new Date().setFullYear((new 19 | Date().getFullYear() - 21)) }, 20 | { name : 'lilly', age : 26, birthday : new Date().setFullYear((new 21 | Date().getFullYear() - 26)) }, 22 | { name : 'alucard', age : 1000, birthday : new Date().setFullYear((new 23 | Date().getFullYear() - 1000)) }, 24 | ]; 25 | 26 | 27 | // to connect to a replica set, pass in the comma delimited uri and optionally 28 | // any connection options such as the rs_name. 29 | var opts = { 30 | replSet : { rs_name : "rs0" } 31 | }; 32 | mongoose.connect('mongodb://localhost:27018/persons,localhost:27019,localhost:27020', opts, function (err) { 33 | if (err) throw err; 34 | 35 | // create all of the dummy people 36 | async.each(data, function (item, cb) { 37 | Person.create(item, cb); 38 | }, function (err) { 39 | 40 | // create and delete some data 41 | var prom = Person.find({age : { $lt : 1000 }}).exec(); 42 | 43 | prom.then(function (people) { 44 | console.log("young people: %s", people); 45 | }).then(cleanup); 46 | }); 47 | }); 48 | 49 | function cleanup() { 50 | Person.remove(function() { 51 | mongoose.disconnect(); 52 | }); 53 | } 54 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/error.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * MongooseError constructor 4 | * 5 | * @param {String} msg Error message 6 | * @inherits Error https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error 7 | */ 8 | 9 | function MongooseError (msg) { 10 | Error.call(this); 11 | Error.captureStackTrace(this, arguments.callee); 12 | this.message = msg; 13 | this.name = 'MongooseError'; 14 | }; 15 | 16 | /*! 17 | * Formats error messages 18 | */ 19 | 20 | MongooseError.prototype.formatMessage = function (msg, path, type, val) { 21 | if (!msg) throw new TypeError('message is required'); 22 | 23 | return msg.replace(/{PATH}/, path) 24 | .replace(/{VALUE}/, String(val||'')) 25 | .replace(/{TYPE}/, type || 'declared type'); 26 | } 27 | 28 | /*! 29 | * Inherits from Error. 30 | */ 31 | 32 | MongooseError.prototype.__proto__ = Error.prototype; 33 | 34 | /*! 35 | * Module exports. 36 | */ 37 | 38 | module.exports = exports = MongooseError; 39 | 40 | /** 41 | * The default built-in validator error messages. 42 | * 43 | * @see Error.messages #error_messages_MongooseError-messages 44 | * @api public 45 | */ 46 | 47 | MongooseError.messages = require('./error/messages'); 48 | 49 | // backward compat 50 | MongooseError.Messages = MongooseError.messages; 51 | 52 | /*! 53 | * Expose subclasses 54 | */ 55 | 56 | MongooseError.CastError = require('./error/cast'); 57 | MongooseError.ValidationError = require('./error/validation') 58 | MongooseError.ValidatorError = require('./error/validator') 59 | MongooseError.VersionError =require('./error/version') 60 | MongooseError.OverwriteModelError = require('./error/overwriteModel') 61 | MongooseError.MissingSchemaError = require('./error/missingSchema') 62 | MongooseError.DivergentArrayError = require('./error/divergentArray') 63 | 64 | -------------------------------------------------------------------------------- /lib/error.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * DocoomentError constructor 4 | * 5 | * @param {String} msg Error message 6 | * @inherits Error https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error 7 | */ 8 | 9 | function DocoomentError (msg) { 10 | Error.call(this); 11 | Error.captureStackTrace(this, arguments.callee); 12 | this.message = msg; 13 | this.name = 'DocoomentError'; 14 | }; 15 | 16 | /*! 17 | * Formats error messages 18 | */ 19 | 20 | DocoomentError.prototype.formatMessage = function (msg, path, type, val) { 21 | if (!msg) throw new TypeError('message is required'); 22 | 23 | return msg.replace(/{PATH}/, path) 24 | .replace(/{VALUE}/, String(val||'')) 25 | .replace(/{TYPE}/, type || 'declared type'); 26 | } 27 | 28 | /*! 29 | * Inherits from Error. 30 | */ 31 | 32 | DocoomentError.prototype.__proto__ = Error.prototype; 33 | 34 | /*! 35 | * Module exports. 36 | */ 37 | 38 | module.exports = exports = DocoomentError; 39 | 40 | /** 41 | * The default built-in validator error messages. 42 | * 43 | * @see Error.messages #error_messages_DocoomentError-messages 44 | * @api public 45 | */ 46 | 47 | DocoomentError.messages = require('./error/messages'); 48 | 49 | // backward compat 50 | DocoomentError.Messages = DocoomentError.messages; 51 | 52 | /*! 53 | * Expose subclasses 54 | */ 55 | 56 | DocoomentError.CastError = require('./error/cast'); 57 | DocoomentError.ValidationError = require('./error/validation') 58 | DocoomentError.ValidatorError = require('./error/validator') 59 | DocoomentError.VersionError =require('./error/version') 60 | DocoomentError.OverwriteModelError = require('./error/overwriteModel') 61 | DocoomentError.MissingSchemaError = require('./error/missingSchema') 62 | DocoomentError.DivergentArrayError = require('./error/divergentArray') 63 | 64 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/test/win32/security_buffer_descriptor_tests.js: -------------------------------------------------------------------------------- 1 | exports.setUp = function(callback) { 2 | callback(); 3 | } 4 | 5 | exports.tearDown = function(callback) { 6 | callback(); 7 | } 8 | 9 | exports['Initialize a security Buffer Descriptor'] = function(test) { 10 | var SecurityBufferDescriptor = require('../../lib/sspi.js').SecurityBufferDescriptor 11 | SecurityBuffer = require('../../lib/sspi.js').SecurityBuffer; 12 | 13 | // Create descriptor with single Buffer 14 | var securityDescriptor = new SecurityBufferDescriptor(100); 15 | try { 16 | // Fail to work due to no valid Security Buffer 17 | securityDescriptor = new SecurityBufferDescriptor(["hello"]); 18 | test.ok(false); 19 | } catch(err){} 20 | 21 | // Should Correctly construct SecurityBuffer 22 | var buffer = new SecurityBuffer(SecurityBuffer.DATA, 100); 23 | securityDescriptor = new SecurityBufferDescriptor([buffer]); 24 | // Should correctly return a buffer 25 | var result = securityDescriptor.toBuffer(); 26 | test.equal(100, result.length); 27 | 28 | // Should Correctly construct SecurityBuffer 29 | var buffer = new SecurityBuffer(SecurityBuffer.DATA, new Buffer("hello world")); 30 | securityDescriptor = new SecurityBufferDescriptor([buffer]); 31 | var result = securityDescriptor.toBuffer(); 32 | test.equal("hello world", result.toString()); 33 | 34 | // Test passing in more than one Buffer 35 | var buffer = new SecurityBuffer(SecurityBuffer.DATA, new Buffer("hello world")); 36 | var buffer2 = new SecurityBuffer(SecurityBuffer.STREAM, new Buffer("adam and eve")); 37 | securityDescriptor = new SecurityBufferDescriptor([buffer, buffer2]); 38 | var result = securityDescriptor.toBuffer(); 39 | test.equal("hello worldadam and eve", result.toString()); 40 | test.done(); 41 | } -------------------------------------------------------------------------------- /lib/schema/mixed.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var SchemaType = require('../schematype'); 7 | var utils = require('../utils'); 8 | 9 | /** 10 | * Mixed SchemaType constructor. 11 | * 12 | * @param {String} path 13 | * @param {Object} options 14 | * @inherits SchemaType 15 | * @api private 16 | */ 17 | 18 | function Mixed (path, options) { 19 | if (options && options.default) { 20 | var def = options.default; 21 | if (Array.isArray(def) && 0 === def.length) { 22 | // make sure empty array defaults are handled 23 | options.default = Array; 24 | } else if (!options.shared && 25 | utils.isObject(def) && 26 | 0 === Object.keys(def).length) { 27 | // prevent odd "shared" objects between documents 28 | options.default = function () { 29 | return {} 30 | } 31 | } 32 | } 33 | 34 | SchemaType.call(this, path, options); 35 | }; 36 | 37 | /*! 38 | * Inherits from SchemaType. 39 | */ 40 | 41 | Mixed.prototype.__proto__ = SchemaType.prototype; 42 | 43 | /** 44 | * Required validator 45 | * 46 | * @api private 47 | */ 48 | 49 | Mixed.prototype.checkRequired = function (val) { 50 | return (val !== undefined) && (val !== null); 51 | }; 52 | 53 | /** 54 | * Casts `val` for Mixed. 55 | * 56 | * _this is a no-op_ 57 | * 58 | * @param {Object} value to cast 59 | * @api private 60 | */ 61 | 62 | Mixed.prototype.cast = function (val) { 63 | return val; 64 | }; 65 | 66 | /** 67 | * Casts contents for queries. 68 | * 69 | * @param {String} $cond 70 | * @param {any} [val] 71 | * @api private 72 | */ 73 | 74 | Mixed.prototype.castForQuery = function ($cond, val) { 75 | if (arguments.length === 2) return val; 76 | return $cond; 77 | }; 78 | 79 | /*! 80 | * Module exports. 81 | */ 82 | 83 | module.exports = Mixed; 84 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/regexp-clone/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "regexp-clone", 3 | "version": "0.0.1", 4 | "description": "Clone RegExps with options", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "make test" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/aheckmann/regexp-clone.git" 12 | }, 13 | "keywords": [ 14 | "RegExp", 15 | "clone" 16 | ], 17 | "author": { 18 | "name": "Aaron Heckmann", 19 | "email": "aaron.heckmann+github@gmail.com" 20 | }, 21 | "license": "MIT", 22 | "devDependencies": { 23 | "mocha": "1.8.1" 24 | }, 25 | "readme": "#regexp-clone\n==============\n\nClones RegExps with flag preservation\n\n```js\nvar regexpClone = require('regexp-clone');\n\nvar a = /somethin/g;\nconsole.log(a.global); // true\n\nvar b = regexpClone(a);\nconsole.log(b.global); // true\n```\n\n## License\n\n[MIT](https://github.com/aheckmann/regexp-clone/blob/master/LICENSE)\n", 26 | "readmeFilename": "README.md", 27 | "_id": "regexp-clone@0.0.1", 28 | "dist": { 29 | "shasum": "a7c2e09891fdbf38fbb10d376fb73003e68ac589", 30 | "tarball": "http://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz" 31 | }, 32 | "_from": "regexp-clone@0.0.1", 33 | "_npmVersion": "1.2.14", 34 | "_npmUser": { 35 | "name": "aaron", 36 | "email": "aaron.heckmann+github@gmail.com" 37 | }, 38 | "maintainers": [ 39 | { 40 | "name": "aaron", 41 | "email": "aaron.heckmann+github@gmail.com" 42 | } 43 | ], 44 | "directories": {}, 45 | "_shasum": "a7c2e09891fdbf38fbb10d376fb73003e68ac589", 46 | "_resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", 47 | "bugs": { 48 | "url": "https://github.com/aheckmann/regexp-clone/issues" 49 | }, 50 | "homepage": "https://github.com/aheckmann/regexp-clone" 51 | } 52 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/schema/mixed.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies. 4 | */ 5 | 6 | var SchemaType = require('../schematype'); 7 | var utils = require('../utils'); 8 | 9 | /** 10 | * Mixed SchemaType constructor. 11 | * 12 | * @param {String} path 13 | * @param {Object} options 14 | * @inherits SchemaType 15 | * @api private 16 | */ 17 | 18 | function Mixed (path, options) { 19 | if (options && options.default) { 20 | var def = options.default; 21 | if (Array.isArray(def) && 0 === def.length) { 22 | // make sure empty array defaults are handled 23 | options.default = Array; 24 | } else if (!options.shared && 25 | utils.isObject(def) && 26 | 0 === Object.keys(def).length) { 27 | // prevent odd "shared" objects between documents 28 | options.default = function () { 29 | return {} 30 | } 31 | } 32 | } 33 | 34 | SchemaType.call(this, path, options); 35 | }; 36 | 37 | /*! 38 | * Inherits from SchemaType. 39 | */ 40 | 41 | Mixed.prototype.__proto__ = SchemaType.prototype; 42 | 43 | /** 44 | * Required validator 45 | * 46 | * @api private 47 | */ 48 | 49 | Mixed.prototype.checkRequired = function (val) { 50 | return (val !== undefined) && (val !== null); 51 | }; 52 | 53 | /** 54 | * Casts `val` for Mixed. 55 | * 56 | * _this is a no-op_ 57 | * 58 | * @param {Object} value to cast 59 | * @api private 60 | */ 61 | 62 | Mixed.prototype.cast = function (val) { 63 | return val; 64 | }; 65 | 66 | /** 67 | * Casts contents for queries. 68 | * 69 | * @param {String} $cond 70 | * @param {any} [val] 71 | * @api private 72 | */ 73 | 74 | Mixed.prototype.castForQuery = function ($cond, val) { 75 | if (arguments.length === 2) return val; 76 | return $cond; 77 | }; 78 | 79 | /*! 80 | * Module exports. 81 | */ 82 | 83 | module.exports = Mixed; 84 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/isarray/README.md: -------------------------------------------------------------------------------- 1 | 2 | # isarray 3 | 4 | `Array#isArray` for older browsers. 5 | 6 | ## Usage 7 | 8 | ```js 9 | var isArray = require('isarray'); 10 | 11 | console.log(isArray([])); // => true 12 | console.log(isArray({})); // => false 13 | ``` 14 | 15 | ## Installation 16 | 17 | With [npm](http://npmjs.org) do 18 | 19 | ```bash 20 | $ npm install isarray 21 | ``` 22 | 23 | Then bundle for the browser with 24 | [browserify](https://github.com/substack/browserify). 25 | 26 | With [component](http://component.io) do 27 | 28 | ```bash 29 | $ component install juliangruber/isarray 30 | ``` 31 | 32 | ## License 33 | 34 | (MIT) 35 | 36 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 37 | 38 | Permission is hereby granted, free of charge, to any person obtaining a copy of 39 | this software and associated documentation files (the "Software"), to deal in 40 | the Software without restriction, including without limitation the rights to 41 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 42 | of the Software, and to permit persons to whom the Software is furnished to do 43 | so, subject to the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be included in all 46 | copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 54 | SOFTWARE. 55 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/lib/bson/index.js: -------------------------------------------------------------------------------- 1 | try { 2 | exports.BSONPure = require('./bson'); 3 | exports.BSONNative = require('../../ext'); 4 | } catch(err) { 5 | // do nothing 6 | } 7 | 8 | [ './binary_parser' 9 | , './binary' 10 | , './code' 11 | , './db_ref' 12 | , './double' 13 | , './max_key' 14 | , './min_key' 15 | , './objectid' 16 | , './symbol' 17 | , './timestamp' 18 | , './long'].forEach(function (path) { 19 | var module = require('./' + path); 20 | for (var i in module) { 21 | exports[i] = module[i]; 22 | } 23 | }); 24 | 25 | // Exports all the classes for the NATIVE JS BSON Parser 26 | exports.native = function() { 27 | var classes = {}; 28 | // Map all the classes 29 | [ './binary_parser' 30 | , './binary' 31 | , './code' 32 | , './db_ref' 33 | , './double' 34 | , './max_key' 35 | , './min_key' 36 | , './objectid' 37 | , './symbol' 38 | , './timestamp' 39 | , './long' 40 | , '../../ext' 41 | ].forEach(function (path) { 42 | var module = require('./' + path); 43 | for (var i in module) { 44 | classes[i] = module[i]; 45 | } 46 | }); 47 | // Return classes list 48 | return classes; 49 | } 50 | 51 | // Exports all the classes for the PURE JS BSON Parser 52 | exports.pure = function() { 53 | var classes = {}; 54 | // Map all the classes 55 | [ './binary_parser' 56 | , './binary' 57 | , './code' 58 | , './db_ref' 59 | , './double' 60 | , './max_key' 61 | , './min_key' 62 | , './objectid' 63 | , './symbol' 64 | , './timestamp' 65 | , './long' 66 | , '././bson'].forEach(function (path) { 67 | var module = require('./' + path); 68 | for (var i in module) { 69 | classes[i] = module[i]; 70 | } 71 | }); 72 | // Return classes list 73 | return classes; 74 | } 75 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/node_modules/inherits/README.md: -------------------------------------------------------------------------------- 1 | Browser-friendly inheritance fully compatible with standard node.js 2 | [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). 3 | 4 | This package exports standard `inherits` from node.js `util` module in 5 | node environment, but also provides alternative browser-friendly 6 | implementation through [browser 7 | field](https://gist.github.com/shtylman/4339901). Alternative 8 | implementation is a literal copy of standard one located in standalone 9 | module to avoid requiring of `util`. It also has a shim for old 10 | browsers with no `Object.create` support. 11 | 12 | While keeping you sure you are using standard `inherits` 13 | implementation in node.js environment, it allows bundlers such as 14 | [browserify](https://github.com/substack/node-browserify) to not 15 | include full `util` package to your client code if all you need is 16 | just `inherits` function. It worth, because browser shim for `util` 17 | package is large and `inherits` is often the single function you need 18 | from it. 19 | 20 | It's recommended to use this package instead of 21 | `require('util').inherits` for any code that has chances to be used 22 | not only in node.js but in browser too. 23 | 24 | ## usage 25 | 26 | ```js 27 | var inherits = require('inherits'); 28 | // then use exactly as the standard one 29 | ``` 30 | 31 | ## note on version ~1.0 32 | 33 | Version ~1.0 had completely different motivation and is not compatible 34 | neither with 2.0 nor with standard node.js `inherits`. 35 | 36 | If you are using version ~1.0 and planning to switch to ~2.0, be 37 | careful: 38 | 39 | * new version uses `super_` instead of `super` for referencing 40 | superclass 41 | * new version overwrites current prototype while old one preserves any 42 | existing fields on it 43 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/lib/mongodb/index.js: -------------------------------------------------------------------------------- 1 | try { 2 | exports.BSONPure = require('bson').BSONPure; 3 | exports.BSONNative = require('bson').BSONNative; 4 | } catch(err) { 5 | // do nothing 6 | } 7 | 8 | // export the driver version 9 | exports.version = require('../../package').version; 10 | 11 | [ 'commands/base_command' 12 | , 'admin' 13 | , 'collection' 14 | , 'connection/read_preference' 15 | , 'connection/connection' 16 | , 'connection/server' 17 | , 'connection/mongos' 18 | , 'connection/repl_set/repl_set' 19 | , 'mongo_client' 20 | , 'cursor' 21 | , 'db' 22 | , 'mongo_client' 23 | , 'gridfs/grid' 24 | , 'gridfs/chunk' 25 | , 'gridfs/gridstore'].forEach(function (path) { 26 | var module = require('./' + path); 27 | for (var i in module) { 28 | exports[i] = module[i]; 29 | } 30 | }); 31 | 32 | // backwards compat 33 | exports.ReplSetServers = exports.ReplSet; 34 | // Add BSON Classes 35 | exports.Binary = require('bson').Binary; 36 | exports.Code = require('bson').Code; 37 | exports.DBRef = require('bson').DBRef; 38 | exports.Double = require('bson').Double; 39 | exports.Long = require('bson').Long; 40 | exports.MinKey = require('bson').MinKey; 41 | exports.MaxKey = require('bson').MaxKey; 42 | exports.ObjectID = require('bson').ObjectID; 43 | exports.Symbol = require('bson').Symbol; 44 | exports.Timestamp = require('bson').Timestamp; 45 | // Add BSON Parser 46 | exports.BSON = require('bson').BSONPure.BSON; 47 | 48 | // Set up the connect function 49 | var connect = exports.Db.connect; 50 | 51 | // Add the pure and native backward compatible functions 52 | exports.pure = exports.native = function() { 53 | return connect; 54 | } 55 | 56 | // Map all values to the exports value 57 | for(var name in exports) { 58 | connect[name] = exports[name]; 59 | } 60 | 61 | // Set our exports to be the connect function 62 | module.exports = connect; 63 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/kerberos.cc: -------------------------------------------------------------------------------- 1 | #include "kerberos.h" 2 | #include 3 | #include 4 | #include "base64.h" 5 | #include "wrappers/security_buffer.h" 6 | #include "wrappers/security_buffer_descriptor.h" 7 | #include "wrappers/security_context.h" 8 | #include "wrappers/security_credentials.h" 9 | 10 | Persistent Kerberos::constructor_template; 11 | 12 | // VException object (causes throw in calling code) 13 | static Handle VException(const char *msg) { 14 | HandleScope scope; 15 | return ThrowException(Exception::Error(String::New(msg))); 16 | } 17 | 18 | Kerberos::Kerberos() : ObjectWrap() { 19 | } 20 | 21 | void Kerberos::Initialize(v8::Handle target) { 22 | // Grab the scope of the call from Node 23 | HandleScope scope; 24 | // Define a new function template 25 | Local t = FunctionTemplate::New(Kerberos::New); 26 | constructor_template = Persistent::New(t); 27 | constructor_template->InstanceTemplate()->SetInternalFieldCount(1); 28 | constructor_template->SetClassName(String::NewSymbol("Kerberos")); 29 | // Set the symbol 30 | target->ForceSet(String::NewSymbol("Kerberos"), constructor_template->GetFunction()); 31 | } 32 | 33 | Handle Kerberos::New(const Arguments &args) { 34 | // Load the security.dll library 35 | load_library(); 36 | // Create a Kerberos instance 37 | Kerberos *kerberos = new Kerberos(); 38 | // Return the kerberos object 39 | kerberos->Wrap(args.This()); 40 | return args.This(); 41 | } 42 | 43 | // Exporting function 44 | extern "C" void init(Handle target) { 45 | HandleScope scope; 46 | Kerberos::Initialize(target); 47 | SecurityContext::Initialize(target); 48 | SecurityBuffer::Initialize(target); 49 | SecurityBufferDescriptor::Initialize(target); 50 | SecurityCredentials::Initialize(target); 51 | } 52 | 53 | NODE_MODULE(kerberos, init); 54 | -------------------------------------------------------------------------------- /lib/schema/boolean.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Module dependencies. 3 | */ 4 | 5 | var SchemaType = require('../schematype'); 6 | 7 | /** 8 | * Boolean SchemaType constructor. 9 | * 10 | * @param {String} path 11 | * @param {Object} options 12 | * @inherits SchemaType 13 | * @api private 14 | */ 15 | 16 | function SchemaBoolean (path, options) { 17 | SchemaType.call(this, path, options); 18 | }; 19 | 20 | /*! 21 | * Inherits from SchemaType. 22 | */ 23 | SchemaBoolean.prototype.__proto__ = SchemaType.prototype; 24 | 25 | /** 26 | * Required validator 27 | * 28 | * @api private 29 | */ 30 | 31 | SchemaBoolean.prototype.checkRequired = function (value) { 32 | return value === true || value === false; 33 | }; 34 | 35 | /** 36 | * Casts to boolean 37 | * 38 | * @param {Object} value 39 | * @api private 40 | */ 41 | 42 | SchemaBoolean.prototype.cast = function (value) { 43 | if (null === value) return value; 44 | if ('0' === value) return false; 45 | if ('true' === value) return true; 46 | if ('false' === value) return false; 47 | return !! value; 48 | } 49 | 50 | /*! 51 | * ignore 52 | */ 53 | 54 | function handleArray (val) { 55 | var self = this; 56 | return val.map(function (m) { 57 | return self.cast(m); 58 | }); 59 | } 60 | 61 | SchemaBoolean.$conditionalHandlers = { 62 | '$in': handleArray 63 | } 64 | 65 | /** 66 | * Casts contents for queries. 67 | * 68 | * @param {String} $conditional 69 | * @param {any} val 70 | * @api private 71 | */ 72 | 73 | SchemaBoolean.prototype.castForQuery = function ($conditional, val) { 74 | var handler; 75 | if (2 === arguments.length) { 76 | handler = SchemaBoolean.$conditionalHandlers[$conditional]; 77 | 78 | if (handler) { 79 | return handler.call(this, val); 80 | } 81 | 82 | return this.cast(val); 83 | } 84 | 85 | return this.cast($conditional); 86 | }; 87 | 88 | /*! 89 | * Module exports. 90 | */ 91 | 92 | module.exports = SchemaBoolean; 93 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | var config = require('./config') 2 | docooment = require('../index'), 3 | Schema = docooment.Schema; 4 | a 5 | 6 | docooment.connect(config.uri, config.port, config.database , config.options, function(err){ 7 | if(err) return console.error(err); 8 | docooment.set('debug', true) 9 | 10 | console.log('CONNECTED') 11 | 12 | var UserSchema = new Schema({ 13 | email: { type: String, lowercase: true }, 14 | firstName: String, 15 | lastName: String, 16 | }); 17 | 18 | var User = docooment.model('User', UserSchema); 19 | 20 | var CertificateSchema = new Schema({ 21 | title: { type: String}, 22 | }); 23 | 24 | var Certificate = docooment.model('Certificate', CertificateSchema); 25 | 26 | var user = new User({firstName: 'Gianluca'}); 27 | //console.log(user); 28 | 29 | user.save(function (err) { 30 | if (err) console.error(err) 31 | console.log('user', user); 32 | 33 | User.find({firstName: 'Gianluca'}).limit(5).sort({id:1}).exec(function(err, users){ 34 | if(err) return console.error(err); 35 | //console.log(users) 36 | console.log(users[0]) 37 | 38 | User.update({_id: users[0]._id}, {lastName: 'Pengo'}, function(err, results){ 39 | if(err) return console.error(err); 40 | console.log('updated', results); 41 | 42 | users[0].lastName = 'Rossi'; 43 | users[0].save(function(err, results){ 44 | if(err) return console.error(err); 45 | 46 | console.log('saved', results) 47 | 48 | User.remove({_id: users[0]}, function(err){ 49 | if(err) return console.error(err); 50 | console.log('deleted'); 51 | 52 | 53 | Certificate.create({title: 'prova'}, function(err, certificate){ 54 | console.log(err, certificate); 55 | }); 56 | }); 57 | }); 58 | }); 59 | }); 60 | }); 61 | 62 | /*User.create({firstName: 'Gianluca'}, function (err, user) { 63 | if (err) console.error(err) 64 | console.log('user', user); 65 | });*/ 66 | }); 67 | 68 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/schema/boolean.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Module dependencies. 3 | */ 4 | 5 | var SchemaType = require('../schematype'); 6 | 7 | /** 8 | * Boolean SchemaType constructor. 9 | * 10 | * @param {String} path 11 | * @param {Object} options 12 | * @inherits SchemaType 13 | * @api private 14 | */ 15 | 16 | function SchemaBoolean (path, options) { 17 | SchemaType.call(this, path, options); 18 | }; 19 | 20 | /*! 21 | * Inherits from SchemaType. 22 | */ 23 | SchemaBoolean.prototype.__proto__ = SchemaType.prototype; 24 | 25 | /** 26 | * Required validator 27 | * 28 | * @api private 29 | */ 30 | 31 | SchemaBoolean.prototype.checkRequired = function (value) { 32 | return value === true || value === false; 33 | }; 34 | 35 | /** 36 | * Casts to boolean 37 | * 38 | * @param {Object} value 39 | * @api private 40 | */ 41 | 42 | SchemaBoolean.prototype.cast = function (value) { 43 | if (null === value) return value; 44 | if ('0' === value) return false; 45 | if ('true' === value) return true; 46 | if ('false' === value) return false; 47 | return !! value; 48 | } 49 | 50 | /*! 51 | * ignore 52 | */ 53 | 54 | function handleArray (val) { 55 | var self = this; 56 | return val.map(function (m) { 57 | return self.cast(m); 58 | }); 59 | } 60 | 61 | SchemaBoolean.$conditionalHandlers = { 62 | '$in': handleArray 63 | } 64 | 65 | /** 66 | * Casts contents for queries. 67 | * 68 | * @param {String} $conditional 69 | * @param {any} val 70 | * @api private 71 | */ 72 | 73 | SchemaBoolean.prototype.castForQuery = function ($conditional, val) { 74 | var handler; 75 | if (2 === arguments.length) { 76 | handler = SchemaBoolean.$conditionalHandlers[$conditional]; 77 | 78 | if (handler) { 79 | return handler.call(this, val); 80 | } 81 | 82 | return this.cast(val); 83 | } 84 | 85 | return this.cast($conditional); 86 | }; 87 | 88 | /*! 89 | * Module exports. 90 | */ 91 | 92 | module.exports = SchemaBoolean; 93 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/lib/_stream_passthrough.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | // a passthrough stream. 23 | // basically just the most minimal sort of Transform stream. 24 | // Every written chunk gets output as-is. 25 | 26 | module.exports = PassThrough; 27 | 28 | var Transform = require('./_stream_transform'); 29 | 30 | /**/ 31 | var util = require('core-util-is'); 32 | util.inherits = require('inherits'); 33 | /**/ 34 | 35 | util.inherits(PassThrough, Transform); 36 | 37 | function PassThrough(options) { 38 | if (!(this instanceof PassThrough)) 39 | return new PassThrough(options); 40 | 41 | Transform.call(this, options); 42 | } 43 | 44 | PassThrough.prototype._transform = function(chunk, encoding, cb) { 45 | cb(null, chunk); 46 | }; 47 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/lib/win32/wrappers/security_credentials.h: -------------------------------------------------------------------------------- 1 | #ifndef SECURITY_CREDENTIALS_H 2 | #define SECURITY_CREDENTIALS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define SECURITY_WIN32 1 9 | 10 | #include 11 | #include 12 | #include 13 | #include "../worker.h" 14 | #include 15 | 16 | extern "C" { 17 | #include "../kerberos_sspi.h" 18 | } 19 | 20 | // SEC_WINNT_AUTH_IDENTITY makes it unusually hard 21 | // to compile for both Unicode and ansi, so I use this macro: 22 | #ifdef _UNICODE 23 | #define USTR(str) (str) 24 | #else 25 | #define USTR(str) ((unsigned char*)(str)) 26 | #endif 27 | 28 | using namespace v8; 29 | using namespace node; 30 | 31 | class SecurityCredentials : public ObjectWrap { 32 | public: 33 | SecurityCredentials(); 34 | ~SecurityCredentials(); 35 | 36 | // Pointer to context object 37 | SEC_WINNT_AUTH_IDENTITY m_Identity; 38 | // credentials 39 | CredHandle m_Credentials; 40 | // Expiry time for ticket 41 | TimeStamp Expiration; 42 | 43 | // Has instance check 44 | static inline bool HasInstance(Handle val) { 45 | if (!val->IsObject()) return false; 46 | Local obj = val->ToObject(); 47 | return constructor_template->HasInstance(obj); 48 | }; 49 | 50 | // Functions available from V8 51 | static void Initialize(Handle target); 52 | static Handle AquireSync(const Arguments &args); 53 | static Handle Aquire(const Arguments &args); 54 | 55 | // Constructor used for creating new Long objects from C++ 56 | static Persistent constructor_template; 57 | 58 | private: 59 | // Create a new instance 60 | static Handle New(const Arguments &args); 61 | // Handles the uv calls 62 | static void Process(uv_work_t* work_req); 63 | // Called after work is done 64 | static void After(uv_work_t* work_req); 65 | }; 66 | 67 | #endif -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to the driver 2 | 3 | ### Bugfixes 4 | 5 | - Before starting to write code, look for existing [tickets](https://jira.mongodb.org/browse/NODE) or [create one](https://jira.mongodb.org/secure/CreateIssue!default.jspa) for your specific issue under the "Node Driver" project. That way you avoid working on something that might not be of interest or that has been addressed already in a different branch. 6 | - Fork the [repo](https://github.com/mongodb/node-mongodb-native) _or_ for small documentation changes, navigate to the source on github and click the [Edit](https://github.com/blog/844-forking-with-the-edit-button) button. 7 | - Follow the general coding style of the rest of the project: 8 | - 2 space tabs 9 | - no trailing whitespace 10 | - comma last 11 | - inline documentation for new methods, class members, etc 12 | - 0 space between conditionals/functions, and their parenthesis and curly braces 13 | - `if(..) {` 14 | - `for(..) {` 15 | - `while(..) {` 16 | - `function(err) {` 17 | - Write tests and make sure they pass (execute `npm test` from the cmd line to run the test suite). 18 | 19 | ### Documentation 20 | 21 | To contribute to the [API documentation](http://mongodb.github.com/node-mongodb-native/) just make your changes to the inline documentation of the appropriate [source code](https://github.com/mongodb/node-mongodb-native/tree/master/docs) in the master branch and submit a [pull request](https://help.github.com/articles/using-pull-requests/). You might also use the github [Edit](https://github.com/blog/844-forking-with-the-edit-button) button. 22 | 23 | If you'd like to preview your documentation changes, first commit your changes to your local master branch, then execute `make generate_docs`. Make sure you have the python documentation framework sphinx installed `easy_install sphinx`. The docs are generated under `docs/build'. If all looks good, submit a [pull request](https://help.github.com/articles/using-pull-requests/) to the master branch with your changes. 24 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/readable-stream/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "readable-stream", 3 | "version": "1.0.33", 4 | "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", 5 | "main": "readable.js", 6 | "dependencies": { 7 | "core-util-is": "~1.0.0", 8 | "isarray": "0.0.1", 9 | "string_decoder": "~0.10.x", 10 | "inherits": "~2.0.1" 11 | }, 12 | "devDependencies": { 13 | "tap": "~0.2.6" 14 | }, 15 | "scripts": { 16 | "test": "tap test/simple/*.js" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com/isaacs/readable-stream" 21 | }, 22 | "keywords": [ 23 | "readable", 24 | "stream", 25 | "pipe" 26 | ], 27 | "browser": { 28 | "util": false 29 | }, 30 | "author": { 31 | "name": "Isaac Z. Schlueter", 32 | "email": "i@izs.me", 33 | "url": "http://blog.izs.me/" 34 | }, 35 | "license": "MIT", 36 | "gitHead": "0bf97a117c5646556548966409ebc57a6dda2638", 37 | "bugs": { 38 | "url": "https://github.com/isaacs/readable-stream/issues" 39 | }, 40 | "homepage": "https://github.com/isaacs/readable-stream", 41 | "_id": "readable-stream@1.0.33", 42 | "_shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c", 43 | "_from": "readable-stream@latest", 44 | "_npmVersion": "1.4.28", 45 | "_npmUser": { 46 | "name": "rvagg", 47 | "email": "rod@vagg.org" 48 | }, 49 | "maintainers": [ 50 | { 51 | "name": "isaacs", 52 | "email": "i@izs.me" 53 | }, 54 | { 55 | "name": "tootallnate", 56 | "email": "nathan@tootallnate.net" 57 | }, 58 | { 59 | "name": "rvagg", 60 | "email": "rod@vagg.org" 61 | } 62 | ], 63 | "dist": { 64 | "shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c", 65 | "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz" 66 | }, 67 | "directories": {}, 68 | "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", 69 | "readme": "ERROR: No README data found!" 70 | } 71 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/querybuilder/querybuilder.js: -------------------------------------------------------------------------------- 1 | 2 | // import async to make control flow simplier 3 | var async = require('async'); 4 | 5 | // import the rest of the normal stuff 6 | var mongoose = require('../../lib'); 7 | 8 | require('./person.js')(); 9 | 10 | var Person = mongoose.model('Person'); 11 | 12 | // define some dummy data 13 | var data = [ 14 | { name : 'bill', age : 25, birthday : new Date().setFullYear((new 15 | Date().getFullYear() - 25)) }, 16 | { name : 'mary', age : 30, birthday : new Date().setFullYear((new 17 | Date().getFullYear() - 30)) }, 18 | { name : 'bob', age : 21, birthday : new Date().setFullYear((new 19 | Date().getFullYear() - 21)) }, 20 | { name : 'lilly', age : 26, birthday : new Date().setFullYear((new 21 | Date().getFullYear() - 26)) }, 22 | { name : 'alucard', age : 1000, birthday : new Date().setFullYear((new 23 | Date().getFullYear() - 1000)) }, 24 | ]; 25 | 26 | 27 | mongoose.connect('mongodb://localhost/persons', function (err) { 28 | if (err) throw err; 29 | 30 | // create all of the dummy people 31 | async.each(data, function (item, cb) { 32 | Person.create(item, cb); 33 | }, function (err) { 34 | if (err) throw err; 35 | 36 | // when querying data, instead of providing a callback, you can instead 37 | // leave that off and get a query object returned 38 | var query = Person.find({ age : { $lt : 1000 }}); 39 | 40 | // this allows you to continue applying modifiers to it 41 | query.sort('birthday'); 42 | query.select('name'); 43 | 44 | // you can chain them together as well 45 | // a full list of methods can be found: 46 | // http://mongoosejs.com/docs/api.html#query-js 47 | query.where('age').gt(21); 48 | 49 | // finally, when ready to execute the query, call the exec() function 50 | query.exec(function (err, results) { 51 | if (err) throw err; 52 | 53 | console.log(results); 54 | 55 | cleanup(); 56 | }); 57 | 58 | }); 59 | }); 60 | 61 | function cleanup() { 62 | Person.remove(function() { 63 | mongoose.disconnect(); 64 | }); 65 | } 66 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bson", 3 | "description": "A bson parser for node.js and the browser", 4 | "keywords": [ 5 | "mongodb", 6 | "bson", 7 | "parser" 8 | ], 9 | "version": "0.2.15", 10 | "author": { 11 | "name": "Christian Amor Kvalheim", 12 | "email": "christkv@gmail.com" 13 | }, 14 | "contributors": [], 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com/mongodb/js-bson.git" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/mongodb/js-bson/issues" 21 | }, 22 | "dependencies": { 23 | "nan": "1.3.0" 24 | }, 25 | "devDependencies": { 26 | "nodeunit": "0.9.0", 27 | "gleak": "0.2.3", 28 | "one": "2.X.X" 29 | }, 30 | "config": { 31 | "native": false 32 | }, 33 | "main": "./lib/bson/index", 34 | "directories": { 35 | "lib": "./lib/bson" 36 | }, 37 | "engines": { 38 | "node": ">=0.6.19" 39 | }, 40 | "scripts": { 41 | "install": "(node-gyp rebuild 2> builderror.log) || (exit 0)", 42 | "test": "nodeunit ./test/node && TEST_NATIVE=TRUE nodeunit ./test/node" 43 | }, 44 | "browser": "lib/bson/bson.js", 45 | "licenses": [ 46 | { 47 | "type": "Apache License, Version 2.0", 48 | "url": "http://www.apache.org/licenses/LICENSE-2.0" 49 | } 50 | ], 51 | "homepage": "https://github.com/mongodb/js-bson", 52 | "_id": "bson@0.2.15", 53 | "dist": { 54 | "shasum": "556402c74bf33d8008122cc3091dc8b3b90e330c", 55 | "tarball": "http://registry.npmjs.org/bson/-/bson-0.2.15.tgz" 56 | }, 57 | "_from": "bson@~0.2", 58 | "_npmVersion": "1.4.3", 59 | "_npmUser": { 60 | "name": "christkv", 61 | "email": "christkv@gmail.com" 62 | }, 63 | "maintainers": [ 64 | { 65 | "name": "octave", 66 | "email": "chinsay@gmail.com" 67 | }, 68 | { 69 | "name": "christkv", 70 | "email": "christkv@gmail.com" 71 | } 72 | ], 73 | "_shasum": "556402c74bf33d8008122cc3091dc8b3b90e330c", 74 | "_resolved": "https://registry.npmjs.org/bson/-/bson-0.2.15.tgz", 75 | "readme": "ERROR: No README data found!" 76 | } 77 | -------------------------------------------------------------------------------- /lib/queryhelpers.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies 4 | */ 5 | 6 | var utils = require('./utils') 7 | 8 | /*! 9 | * Prepare a set of path options for query population. 10 | * 11 | * @param {Query} query 12 | * @param {Object} options 13 | * @return {Array} 14 | */ 15 | 16 | exports.preparePopulationOptions = function preparePopulationOptions (query, options) { 17 | var pop = utils.object.vals(query.options.populate); 18 | 19 | // lean options should trickle through all queries 20 | if (options.lean) pop.forEach(makeLean); 21 | 22 | return pop; 23 | } 24 | 25 | /*! 26 | * Prepare a set of path options for query population. This is the MongooseQuery 27 | * version 28 | * 29 | * @param {Query} query 30 | * @param {Object} options 31 | * @return {Array} 32 | */ 33 | 34 | exports.preparePopulationOptionsMQ = function preparePopulationOptionsMQ (query, options) { 35 | var pop = utils.object.vals(query._mongooseOptions.populate); 36 | 37 | // lean options should trickle through all queries 38 | if (options.lean) pop.forEach(makeLean); 39 | 40 | return pop; 41 | } 42 | 43 | /*! 44 | * If the document is a mapped discriminator type, it returns a model instance for that type, otherwise, 45 | * it returns an instance of the given model. 46 | * 47 | * @param {Model} model 48 | * @param {Object} doc 49 | * @param {Object} fields 50 | * 51 | * @return {Model} 52 | */ 53 | exports.createModel = function createModel(model, doc, fields) { 54 | var discriminatorMapping = model.schema 55 | ? model.schema.discriminatorMapping 56 | : null; 57 | 58 | var key = discriminatorMapping && discriminatorMapping.isRoot 59 | ? discriminatorMapping.key 60 | : null; 61 | 62 | if (key && doc[key] && model.discriminators && model.discriminators[doc[key]]) { 63 | return new model.discriminators[doc[key]](undefined, fields, true); 64 | } 65 | 66 | return new model(undefined, fields, true); 67 | } 68 | 69 | /*! 70 | * Set each path query option to lean 71 | * 72 | * @param {Object} option 73 | */ 74 | 75 | function makeLean (option) { 76 | option.options || (option.options = {}); 77 | option.options.lean = true; 78 | } 79 | 80 | -------------------------------------------------------------------------------- /lib/docoomentdb/lib/queryhelpers.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Module dependencies 4 | */ 5 | 6 | var utils = require('./utils') 7 | 8 | /*! 9 | * Prepare a set of path options for query population. 10 | * 11 | * @param {Query} query 12 | * @param {Object} options 13 | * @return {Array} 14 | */ 15 | 16 | exports.preparePopulationOptions = function preparePopulationOptions (query, options) { 17 | var pop = utils.object.vals(query.options.populate); 18 | 19 | // lean options should trickle through all queries 20 | if (options.lean) pop.forEach(makeLean); 21 | 22 | return pop; 23 | } 24 | 25 | /*! 26 | * Prepare a set of path options for query population. This is the MongooseQuery 27 | * version 28 | * 29 | * @param {Query} query 30 | * @param {Object} options 31 | * @return {Array} 32 | */ 33 | 34 | exports.preparePopulationOptionsMQ = function preparePopulationOptionsMQ (query, options) { 35 | var pop = utils.object.vals(query._mongooseOptions.populate); 36 | 37 | // lean options should trickle through all queries 38 | if (options.lean) pop.forEach(makeLean); 39 | 40 | return pop; 41 | } 42 | 43 | /*! 44 | * If the document is a mapped discriminator type, it returns a model instance for that type, otherwise, 45 | * it returns an instance of the given model. 46 | * 47 | * @param {Model} model 48 | * @param {Object} doc 49 | * @param {Object} fields 50 | * 51 | * @return {Model} 52 | */ 53 | exports.createModel = function createModel(model, doc, fields) { 54 | var discriminatorMapping = model.schema 55 | ? model.schema.discriminatorMapping 56 | : null; 57 | 58 | var key = discriminatorMapping && discriminatorMapping.isRoot 59 | ? discriminatorMapping.key 60 | : null; 61 | 62 | if (key && doc[key] && model.discriminators && model.discriminators[doc[key]]) { 63 | return new model.discriminators[doc[key]](undefined, fields, true); 64 | } 65 | 66 | return new model(undefined, fields, true); 67 | } 68 | 69 | /*! 70 | * Set each path query option to lean 71 | * 72 | * @param {Object} option 73 | */ 74 | 75 | function makeLean (option) { 76 | option.options || (option.options = {}); 77 | option.options.lean = true; 78 | } 79 | 80 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/bson/build/Release/.deps/Release/obj.target/bson/ext/bson.o.d: -------------------------------------------------------------------------------- 1 | cmd_Release/obj.target/bson/ext/bson.o := g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/gian/.node-gyp/0.10.33/src -I/home/gian/.node-gyp/0.10.33/deps/uv/include -I/home/gian/.node-gyp/0.10.33/deps/v8/include -I../node_modules/nan -fPIC -Wall -Wextra -Wno-unused-parameter -pthread -m64 -O2 -fno-strict-aliasing -fno-tree-vrp -fno-omit-frame-pointer -fno-rtti -MMD -MF ./Release/.deps/Release/obj.target/bson/ext/bson.o.d.raw -c -o Release/obj.target/bson/ext/bson.o ../ext/bson.cc 2 | Release/obj.target/bson/ext/bson.o: ../ext/bson.cc \ 3 | /home/gian/.node-gyp/0.10.33/deps/v8/include/v8.h \ 4 | /home/gian/.node-gyp/0.10.33/deps/v8/include/v8stdint.h \ 5 | /home/gian/.node-gyp/0.10.33/src/node.h \ 6 | /home/gian/.node-gyp/0.10.33/deps/uv/include/uv.h \ 7 | /home/gian/.node-gyp/0.10.33/deps/uv/include/uv-private/uv-unix.h \ 8 | /home/gian/.node-gyp/0.10.33/deps/uv/include/uv-private/ngx-queue.h \ 9 | /home/gian/.node-gyp/0.10.33/deps/uv/include/uv-private/uv-linux.h \ 10 | /home/gian/.node-gyp/0.10.33/src/node_object_wrap.h \ 11 | /home/gian/.node-gyp/0.10.33/src/node.h \ 12 | /home/gian/.node-gyp/0.10.33/src/node_version.h \ 13 | /home/gian/.node-gyp/0.10.33/src/node_buffer.h ../ext/bson.h \ 14 | /home/gian/.node-gyp/0.10.33/src/node_object_wrap.h \ 15 | ../node_modules/nan/nan.h 16 | ../ext/bson.cc: 17 | /home/gian/.node-gyp/0.10.33/deps/v8/include/v8.h: 18 | /home/gian/.node-gyp/0.10.33/deps/v8/include/v8stdint.h: 19 | /home/gian/.node-gyp/0.10.33/src/node.h: 20 | /home/gian/.node-gyp/0.10.33/deps/uv/include/uv.h: 21 | /home/gian/.node-gyp/0.10.33/deps/uv/include/uv-private/uv-unix.h: 22 | /home/gian/.node-gyp/0.10.33/deps/uv/include/uv-private/ngx-queue.h: 23 | /home/gian/.node-gyp/0.10.33/deps/uv/include/uv-private/uv-linux.h: 24 | /home/gian/.node-gyp/0.10.33/src/node_object_wrap.h: 25 | /home/gian/.node-gyp/0.10.33/src/node.h: 26 | /home/gian/.node-gyp/0.10.33/src/node_version.h: 27 | /home/gian/.node-gyp/0.10.33/src/node_buffer.h: 28 | ../ext/bson.h: 29 | /home/gian/.node-gyp/0.10.33/src/node_object_wrap.h: 30 | ../node_modules/nan/nan.h: 31 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mquery/lib/permissions.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var denied = exports; 4 | 5 | denied.distinct = function (self) { 6 | if (self._fields && Object.keys(self._fields).length > 0) { 7 | return 'field selection and slice' 8 | } 9 | 10 | var keys = Object.keys(denied.distinct); 11 | var err; 12 | 13 | keys.every(function (option) { 14 | if (self.options[option]) { 15 | err = option; 16 | return false; 17 | } 18 | return true; 19 | }); 20 | 21 | return err; 22 | }; 23 | denied.distinct.select = 24 | denied.distinct.slice = 25 | denied.distinct.sort = 26 | denied.distinct.limit = 27 | denied.distinct.skip = 28 | denied.distinct.batchSize = 29 | denied.distinct.comment = 30 | denied.distinct.maxScan = 31 | denied.distinct.snapshot = 32 | denied.distinct.hint = 33 | denied.distinct.tailable = true; 34 | 35 | 36 | // aggregation integration 37 | 38 | 39 | denied.findOneAndUpdate = 40 | denied.findOneAndRemove = function (self) { 41 | var keys = Object.keys(denied.findOneAndUpdate); 42 | var err; 43 | 44 | keys.every(function (option) { 45 | if (self.options[option]) { 46 | err = option; 47 | return false; 48 | } 49 | return true; 50 | }); 51 | 52 | return err; 53 | } 54 | denied.findOneAndUpdate.limit = 55 | denied.findOneAndUpdate.skip = 56 | denied.findOneAndUpdate.batchSize = 57 | denied.findOneAndUpdate.maxScan = 58 | denied.findOneAndUpdate.snapshot = 59 | denied.findOneAndUpdate.hint = 60 | denied.findOneAndUpdate.tailable = 61 | denied.findOneAndUpdate.comment = true; 62 | 63 | 64 | denied.count = function (self) { 65 | if (self._fields && Object.keys(self._fields).length > 0) { 66 | return 'field selection and slice' 67 | } 68 | 69 | var keys = Object.keys(denied.count); 70 | var err; 71 | 72 | keys.every(function (option) { 73 | if (self.options[option]) { 74 | err = option; 75 | return false; 76 | } 77 | return true; 78 | }); 79 | 80 | return err; 81 | } 82 | 83 | denied.count.select = 84 | denied.count.slice = 85 | denied.count.sort = 86 | denied.count.batchSize = 87 | denied.count.comment = 88 | denied.count.maxScan = 89 | denied.count.snapshot = 90 | denied.count.hint = 91 | denied.count.tailable = true; 92 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/lean/lean.js: -------------------------------------------------------------------------------- 1 | 2 | // import async to make control flow simplier 3 | var async = require('async'); 4 | 5 | // import the rest of the normal stuff 6 | var mongoose = require('../../lib'); 7 | 8 | require('./person.js')(); 9 | 10 | var Person = mongoose.model('Person'); 11 | 12 | // define some dummy data 13 | var data = [ 14 | { name : 'bill', age : 25, birthday : new Date().setFullYear((new 15 | Date().getFullYear() - 25)), gender : "Male", 16 | likes : ['movies', 'games', 'dogs']}, 17 | { name : 'mary', age : 30, birthday : new Date().setFullYear((new 18 | Date().getFullYear() - 30)), gender : "Female", 19 | likes : ['movies', 'birds', 'cats']}, 20 | { name : 'bob', age : 21, birthday : new Date().setFullYear((new 21 | Date().getFullYear() - 21)), gender : "Male", 22 | likes : ['tv', 'games', 'rabbits']}, 23 | { name : 'lilly', age : 26, birthday : new Date().setFullYear((new 24 | Date().getFullYear() - 26)), gender : "Female", 25 | likes : ['books', 'cats', 'dogs']}, 26 | { name : 'alucard', age : 1000, birthday : new Date().setFullYear((new 27 | Date().getFullYear() - 1000)), gender : "Male", 28 | likes : ['glasses', 'wine', 'the night']}, 29 | ]; 30 | 31 | 32 | mongoose.connect('mongodb://localhost/persons', function (err) { 33 | if (err) throw err; 34 | 35 | // create all of the dummy people 36 | async.each(data, function (item, cb) { 37 | Person.create(item, cb); 38 | }, function (err) { 39 | 40 | // lean queries return just plain javascript objects, not 41 | // MongooseDocuments. This makes them good for high performance read 42 | // situations 43 | 44 | // when using .lean() the default is true, but you can explicitly set the 45 | // value by passing in a boolean value. IE. .lean(false) 46 | var q = Person.find({ age : { $lt : 1000 }}).sort('age').limit(2).lean(); 47 | q.exec(function (err, results) { 48 | if (err) throw err; 49 | console.log("Are the results MongooseDocuments?: %s", results[0] instanceof mongoose.Document); 50 | 51 | console.log(results); 52 | cleanup(); 53 | }); 54 | }); 55 | }); 56 | 57 | function cleanup() { 58 | Person.remove(function() { 59 | mongoose.disconnect(); 60 | }); 61 | } 62 | -------------------------------------------------------------------------------- /lib/docoomentdb/examples/population/population-basic.js: -------------------------------------------------------------------------------- 1 | 2 | var mongoose = require('../../lib') 3 | var Schema = mongoose.Schema; 4 | 5 | console.log('Running mongoose version %s', mongoose.version); 6 | 7 | /** 8 | * Console schema 9 | */ 10 | 11 | var consoleSchema = Schema({ 12 | name: String 13 | , manufacturer: String 14 | , released: Date 15 | }) 16 | var Console = mongoose.model('Console', consoleSchema); 17 | 18 | /** 19 | * Game schema 20 | */ 21 | 22 | var gameSchema = Schema({ 23 | name: String 24 | , developer: String 25 | , released: Date 26 | , consoles: [{ type: Schema.Types.ObjectId, ref: 'Console' }] 27 | }) 28 | var Game = mongoose.model('Game', gameSchema); 29 | 30 | /** 31 | * Connect to the console database on localhost with 32 | * the default port (27017) 33 | */ 34 | 35 | mongoose.connect('mongodb://localhost/console', function (err) { 36 | // if we failed to connect, abort 37 | if (err) throw err; 38 | 39 | // we connected ok 40 | createData(); 41 | }) 42 | 43 | /** 44 | * Data generation 45 | */ 46 | 47 | function createData () { 48 | Console.create({ 49 | name: 'Nintendo 64' 50 | , manufacturer: 'Nintendo' 51 | , released: 'September 29, 1996' 52 | }, function (err, nintendo64) { 53 | if (err) return done(err); 54 | 55 | Game.create({ 56 | name: 'Legend of Zelda: Ocarina of Time' 57 | , developer: 'Nintendo' 58 | , released: new Date('November 21, 1998') 59 | , consoles: [nintendo64] 60 | }, function (err) { 61 | if (err) return done(err); 62 | example(); 63 | }) 64 | }) 65 | } 66 | 67 | /** 68 | * Population 69 | */ 70 | 71 | function example () { 72 | Game 73 | .findOne({ name: /^Legend of Zelda/ }) 74 | .populate('consoles') 75 | .exec(function (err, ocinara) { 76 | if (err) return done(err); 77 | 78 | console.log( 79 | '"%s" was released for the %s on %s' 80 | , ocinara.name 81 | , ocinara.consoles[0].name 82 | , ocinara.released.toLocaleDateString()); 83 | 84 | done(); 85 | }) 86 | } 87 | 88 | function done (err) { 89 | if (err) console.error(err); 90 | Console.remove(function () { 91 | Game.remove(function () { 92 | mongoose.disconnect(); 93 | }) 94 | }) 95 | } 96 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/node_modules/kerberos/test/win32/security_credentials_tests.js: -------------------------------------------------------------------------------- 1 | exports.setUp = function(callback) { 2 | callback(); 3 | } 4 | 5 | exports.tearDown = function(callback) { 6 | callback(); 7 | } 8 | 9 | exports['Initialize a set of security credentials'] = function(test) { 10 | var SecurityCredentials = require('../../lib/sspi.js').SecurityCredentials; 11 | 12 | // Aquire some credentials 13 | try { 14 | var credentials = SecurityCredentials.aquire('Kerberos', 'dev1@10GEN.ME', 'a'); 15 | } catch(err) { 16 | console.dir(err) 17 | test.ok(false); 18 | } 19 | 20 | 21 | 22 | // console.dir(SecurityCredentials); 23 | 24 | // var SecurityBufferDescriptor = require('../../lib/sspi.js').SecurityBufferDescriptor 25 | // SecurityBuffer = require('../../lib/sspi.js').SecurityBuffer; 26 | 27 | // // Create descriptor with single Buffer 28 | // var securityDescriptor = new SecurityBufferDescriptor(100); 29 | // try { 30 | // // Fail to work due to no valid Security Buffer 31 | // securityDescriptor = new SecurityBufferDescriptor(["hello"]); 32 | // test.ok(false); 33 | // } catch(err){} 34 | 35 | // // Should Correctly construct SecurityBuffer 36 | // var buffer = new SecurityBuffer(SecurityBuffer.DATA, 100); 37 | // securityDescriptor = new SecurityBufferDescriptor([buffer]); 38 | // // Should correctly return a buffer 39 | // var result = securityDescriptor.toBuffer(); 40 | // test.equal(100, result.length); 41 | 42 | // // Should Correctly construct SecurityBuffer 43 | // var buffer = new SecurityBuffer(SecurityBuffer.DATA, new Buffer("hello world")); 44 | // securityDescriptor = new SecurityBufferDescriptor([buffer]); 45 | // var result = securityDescriptor.toBuffer(); 46 | // test.equal("hello world", result.toString()); 47 | 48 | // // Test passing in more than one Buffer 49 | // var buffer = new SecurityBuffer(SecurityBuffer.DATA, new Buffer("hello world")); 50 | // var buffer2 = new SecurityBuffer(SecurityBuffer.STREAM, new Buffer("adam and eve")); 51 | // securityDescriptor = new SecurityBufferDescriptor([buffer, buffer2]); 52 | // var result = securityDescriptor.toBuffer(); 53 | // test.equal("hello worldadam and eve", result.toString()); 54 | test.done(); 55 | } -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/mongodb/lib/mongodb/connection/repl_set/repl_set_state.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Interval state object constructor 3 | * 4 | * @ignore 5 | */ 6 | var ReplSetState = function ReplSetState (replset) { 7 | this.errorMessages = []; 8 | this.secondaries = {}; 9 | this.addresses = {}; 10 | this.arbiters = {}; 11 | this.passives = {}; 12 | this.members = []; 13 | this.errors = {}; 14 | this.setName = null; 15 | this.master = null; 16 | this.replset = replset; 17 | } 18 | 19 | ReplSetState.prototype.hasValidServers = function() { 20 | var validServers = []; 21 | if(this.master && this.master.isConnected()) return true; 22 | 23 | if(this.secondaries) { 24 | var keys = Object.keys(this.secondaries) 25 | for(var i = 0; i < keys.length; i++) { 26 | if(this.secondaries[keys[i]].isConnected()) 27 | return true; 28 | } 29 | } 30 | 31 | return false; 32 | } 33 | 34 | ReplSetState.prototype.getAllReadServers = function() { 35 | var candidate_servers = []; 36 | for(var name in this.addresses) { 37 | candidate_servers.push(this.addresses[name]); 38 | } 39 | 40 | // Return all possible read candidates 41 | return candidate_servers; 42 | } 43 | 44 | ReplSetState.prototype.addServer = function(server, master) { 45 | server.name = master.me; 46 | 47 | if(master.ismaster) { 48 | this.master = server; 49 | this.addresses[server.name] = server; 50 | this.replset.emit('joined', "primary", master, server); 51 | } else if(master.secondary) { 52 | this.secondaries[server.name] = server; 53 | this.addresses[server.name] = server; 54 | this.replset.emit('joined', "secondary", master, server); 55 | } else if(master.arbiters) { 56 | this.arbiters[server.name] = server; 57 | this.addresses[server.name] = server; 58 | this.replset.emit('joined', "arbiter", master, server); 59 | } 60 | } 61 | 62 | ReplSetState.prototype.contains = function(host) { 63 | return this.addresses[host] != null; 64 | } 65 | 66 | ReplSetState.prototype.isPrimary = function(server) { 67 | return this.master && this.master.name == server.name; 68 | } 69 | 70 | ReplSetState.prototype.isSecondary = function(server) { 71 | return this.secondaries[server.name] != null; 72 | } 73 | 74 | exports.ReplSetState = ReplSetState; 75 | -------------------------------------------------------------------------------- /lib/docoomentdb/node_modules/ms/README.md: -------------------------------------------------------------------------------- 1 | 2 | # ms.js 3 | 4 | Ever find yourself doing math in your head or writing `1000 * 60 * 60 …`? 5 | Don't want to add obstrusive `Number` prototype extensions to your reusable 6 | / distributable modules and projects? 7 | 8 | `ms` is a tiny utility that you can leverage when your application needs to 9 | accept a number of miliseconds as a parameter. 10 | 11 | If a number is supplied to `ms`, it returns it immediately (e.g: 12 | If a string that contains the number is supplied, it returns it immediately as 13 | a number (e.g: it returns `100` for `'100'`). 14 | 15 | However, if you pass a string with a number and a valid unit, hte number of 16 | equivalent ms is returned. 17 | 18 | ```js 19 | ms('1d') // 86400000 20 | ms('10h') // 36000000 21 | ms('2h') // 7200000 22 | ms('1m') // 60000 23 | ms('5ms') // 5000 24 | ms('100') // '100' 25 | ms(100) // 100 26 | ``` 27 | 28 | ## How to use 29 | 30 | ### Node 31 | 32 | ```js 33 | require('ms') 34 | ``` 35 | 36 | ### Browser 37 | 38 | ```html 39 | 40 | ``` 41 | 42 | ## Credits 43 | 44 | (The MIT License) 45 | 46 | Copyright (c) 2011 Guillermo Rauch <guillermo@learnboost.com> 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining 49 | a copy of this software and associated documentation files (the 50 | 'Software'), to deal in the Software without restriction, including 51 | without limitation the rights to use, copy, modify, merge, publish, 52 | distribute, sublicense, and/or sell copies of the Software, and to 53 | permit persons to whom the Software is furnished to do so, subject to 54 | the following conditions: 55 | 56 | The above copyright notice and this permission notice shall be 57 | included in all copies or substantial portions of the Software. 58 | 59 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 60 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 61 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 62 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 63 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 64 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 65 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 66 | -------------------------------------------------------------------------------- /lib/docoomentdb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docooment", 3 | "description": "DocumentDb ORM", 4 | "version": "0.0.1", 5 | "author": { 6 | "name": "Gianluca Pengo", 7 | "email": "gianluca.pengo@gmail.com" 8 | }, 9 | "keywords": [ 10 | "DocumentDb", 11 | "document", 12 | "model", 13 | "schema", 14 | "database", 15 | "odm", 16 | "data", 17 | "datastore", 18 | "query", 19 | "nosql", 20 | "orm", 21 | "db", 22 | "azure" 23 | ], 24 | "dependencies": { 25 | "mongodb": "1.4.12", 26 | "hooks": "0.2.1", 27 | "ms": "0.1.0", 28 | "sliced": "0.0.5", 29 | "muri": "0.3.1", 30 | "mpromise": "0.4.3", 31 | "mpath": "0.1.1", 32 | "regexp-clone": "0.0.1", 33 | "mquery": "0.8.0" 34 | }, 35 | "devDependencies": { 36 | "mocha": "1.12.0", 37 | "node-static": "0.5.9", 38 | "dox": "0.3.1", 39 | "jade": "0.26.3", 40 | "highlight.js": "7.0.1", 41 | "markdown": "0.3.1", 42 | "promises-aplus-tests": ">= 1.0.2", 43 | "tbd": "0.6.4", 44 | "benchmark": "1.0.0", 45 | "open": "0.0.3", 46 | "async": "0.2.5", 47 | "underscore": "1.5.2" 48 | }, 49 | "directories": { 50 | "lib": "./lib/mongoose" 51 | }, 52 | "scripts": { 53 | "test": "make test" 54 | }, 55 | "main": "./index.js", 56 | "engines": { 57 | "node": ">=0.6.19" 58 | }, 59 | "bugs": { 60 | "url": "https://github.com/learnboost/mongoose/issues/new", 61 | "email": "mongoose-orm@googlegroups.com" 62 | }, 63 | "repository": { 64 | "type": "git", 65 | "url": "git://github.com/LearnBoost/mongoose.git" 66 | }, 67 | "homepage": "http://mongoosejs.com", 68 | "gitHead": "a64c0fa53ff00107999563306f589446fb5f3d80", 69 | "_id": "mongoose@3.8.20", 70 | "_shasum": "41556201100ef2728d1b8635ad7c540fd1f686b7", 71 | "_from": "mongoose@~3.8.8", 72 | "_npmVersion": "1.4.21", 73 | "_npmUser": { 74 | "name": "vkarpov15", 75 | "email": "valkar207@gmail.com" 76 | }, 77 | "maintainers": [ 78 | 79 | ], 80 | "dist": { 81 | "shasum": "41556201100ef2728d1b8635ad7c540fd1f686b7", 82 | "tarball": "http://registry.npmjs.org/mongoose/-/mongoose-3.8.20.tgz" 83 | }, 84 | "_resolved": "https://registry.npmjs.org/mongoose/-/mongoose-3.8.20.tgz", 85 | "readme": "ERROR: No README data found!" 86 | } 87 | --------------------------------------------------------------------------------