{"_id":"@0bdx/mongoish","_rev":"1-3329122ff5d7bfa64c323e2e607ebfbd","name":"@0bdx/mongoish","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@0bdx/mongoish","version":"0.0.1","description":"An in-memory database client, based on `picodb`.","type":"module","engines":{"node":">= 16.16.0"},"main":"mongoish.js","scripts":{"build:prod":"rollup -c","build:types":"tsc mongoish.js --allowJs --declaration --emitDeclarationOnly","build":"for s in {prod,types};do npm run build:$s;done","preflight:test":"echo \"🧬 test.js\" && node test.js","preflight:types":"tsc mongoish.js --allowJs --checkJs --noEmit --lib es2019","preflight":"for s in {test,types};do npm run preflight:$s;done","test":"echo \"🧪 src/test.js\" && node src/test.js"},"repository":{"type":"git","url":"git+https://github.com/0bdx/mongoish.git"},"keywords":["db","mongo","picodb"],"author":{"name":"0bdx","email":"0@0bdx.com","url":"0bdx.com"},"license":"MIT","types":"./mongoish.d.ts","bugs":{"url":"https://github.com/0bdx/mongoish/issues"},"homepage":"https://github.com/0bdx/mongoish#readme","devDependencies":{"@0bdx/build-helpers":"^0.0.4","@rollup/plugin-node-resolve":"^15.0.2","@types/node":"^18.15.11","picodb":"^1.0.4","rollup":"^3.20.2"},"dependencies":{"@0bdx/ainta":"^0.0.15"},"gitHead":"fd5ce628d2e30a2b9d4b694e7da476f2df9828a7","_id":"@0bdx/mongoish@0.0.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-k5Cc7UYFeUPmMB7yEH9KsACgDywghkM5snF7qpJwIe9EdzuOJvc3AZdJSG4Ljwj0PBUmex9Kp4R59puXUWFWBw==","shasum":"bee9620b38437c4be6cfa61431551bbb9c42ce7b","tarball":"https://registry.npmjs.org/@0bdx/mongoish/-/mongoish-0.0.1.tgz","fileCount":5,"unpackedSize":28599,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIExuqH4PQ185R3syHW/XKY4CqIvcq457v6OP7T/uRmKSAiB8CLLb3EXIa2HIyqcXQUAH5ESSrHx4vh3+lOF0edzFwg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN7puACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7Jw/+JkTcplVoytKjkqOymLneb9UlKfYeqC+cEVAM0mabls1CsnU8\r\nUn2zUSYf/GJqsDI6Jymep8igxoxbA/sPWuHvt4vhZnORVjz3VFZsg+7eaWn+\r\nOqi4QHYSxxyohjE3BGCwFuzyGPzfTJuhjbknpre0Z6ruABgajLXbgcbC7Nkz\r\n29QnPMJEHnDxUG0cwMNjxKr38aYiAbIWolwgiAHzrkVYDLj5IqT0L4uu9g3+\r\nM+CW6bifp+ixn/fTnrLc1YeAR9/wGPtv5wdI94nI+3p6fYKwEK7JSVlk9OoB\r\nMpFnBQQAGPzw1MkGxcGcxlOy/0dP+59un1rGPkJ5IuJTYJ6LD3kD8g70Yj1y\r\nzxtgZbODChXwxCz3wHMwFeCMwnfu2rDkFF0bw68VrO5shTC4uuvoG0eSKHzD\r\n4KRoIeMQ/zHvY9gfdHbT7k9QJNqm13ysNoa/sbI2b9VvcUge7hQ2L6uT02hL\r\npW8zWq56S3N9eWuhV9GjGsZKqbjzy0QOFdAaqdEWl6R5sY5edv5HoizYrZAg\r\nMiCUwu+JJ+33+ajKMrtOCGEZbTos5/j+JUcFt7JrDIRLYRIYQt26+p+R+mtp\r\n7c1b1Ka7MLMX4InF1139Otj9gov/AC9VaMQMCA4zTDopkaTlGaCRhS6xpB+g\r\nD8c0KiNMyQhyheMXHX35js9VVDrsEFF+jXk=\r\n=r9sp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"0bdx","email":"0bdx.com@gmail.com"},"directories":{},"maintainers":[{"name":"0bdx","email":"0bdx.com@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongoish_0.0.1_1681373806064_0.4797304701742289"},"_hasShrinkwrap":false},"0.0.2":{"name":"@0bdx/mongoish","version":"0.0.2","description":"An in-memory database client, based on `picodb`.","type":"module","engines":{"node":">= 16.16.0"},"main":"mongoish.js","scripts":{"build:prod":"rollup -c","build:types":"tsc mongoish.js --allowJs --declaration --emitDeclarationOnly","build":"for s in {prod,types};do npm run build:$s;done","preflight:test":"echo \"🧬 test.js\" && node test.js","preflight:types":"tsc mongoish.js --allowJs --checkJs --noEmit --lib es2019","preflight":"for s in {test,types};do npm run preflight:$s;done","test":"echo \"🧪 src/test.js\" && node src/test.js"},"repository":{"type":"git","url":"git+https://github.com/0bdx/mongoish.git"},"keywords":["db","mongo","picodb"],"author":{"name":"0bdx","email":"0@0bdx.com","url":"0bdx.com"},"license":"MIT","types":"./mongoish.d.ts","bugs":{"url":"https://github.com/0bdx/mongoish/issues"},"homepage":"https://github.com/0bdx/mongoish#readme","devDependencies":{"@0bdx/build-helpers":"^0.0.4","@rollup/plugin-node-resolve":"^15.0.2","@types/node":"^18.15.11","picodb":"^1.0.4","rollup":"^3.20.2"},"dependencies":{"@0bdx/ainta":"^0.0.16"},"gitHead":"24962a77ded82aada17ea8c3e0a572897b495e85","_id":"@0bdx/mongoish@0.0.2","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-2OutYcvj9mqjAUHCTBnYvU0Cbmg7uTN4BHVsHCeqDCoRb1ZGccwTZfUFMmXixnYW5CPOVUjVs0fHOM7Xev+9rw==","shasum":"42b1c0731028ec8c77b37ed790345f07f2ed3b97","tarball":"https://registry.npmjs.org/@0bdx/mongoish/-/mongoish-0.0.2.tgz","fileCount":5,"unpackedSize":28710,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwdTwO4zukOimRUy78PuXBGD3YxTAM4ygX1A3N82OIjQIhAK5oF32EElObFit3WLLkVPKemsj/W/0P3d8tBS51zKmy"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOUiFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphWw/9EKCbqittaR0xA023HjThGuyFVamLGHk7jCBQLTDQ3tkI7uXD\r\nVeMe12RkYESdAyyy5ZsRbsfl1uM18d5Lwh1RhbX4UORph14hpFLwHXLwCZoh\r\nPf7Oh3TPRsRuDV2nSZLS2ZZ2kyrQLybIHf5MRBqmE8LCNx+2ZdWSktdscAvs\r\nDnM1lsJcS8d9/N0OimVJ12ShDXdg8Xab/nRE76s75Nhyii0F45IUuWrltlQy\r\n3E5kqsJSZU2ZLVr30jlKUq0NcGdVqQNJp0VBm64O0vmMU+QnFl8MyZOcY7sH\r\nUpRe42gPYIMepwqAasqWhSZnCaq9/kTj+btF80to10kjbYSHOoYFKi2YCBi6\r\nOPg3Fpnis50NePZw9GU94Rh68jDYBIaQC3usfkN9VqDpgS29pOox1dH7cdaU\r\nEO1QPNZaY1T5chIJAXX3No9u96bVwxH/RB8IxNAIaSDaYVYbll0CAHLc3v+2\r\nP73JFewEILbThaH6/bl456pR1YRxpNKqIqDhx2H1aaq63HYYi8gQLRQleMAR\r\nB1iNq09JHxQhlWyIIKV81/zikKy2WdXgzYyyp+TQ2VGunj4YD/n6MOGSSwHH\r\n7zwAIdWZE/fAVZ54tI51QxCcMXlA4LWR2Cm2j8cl9T5cRcUsntcOkynXb55s\r\nNn0Z4x8+Qrp4Gig3Dkct54O+qjdYJ+5zhgI=\r\n=Gs5V\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"0bdx","email":"0bdx.com@gmail.com"},"directories":{},"maintainers":[{"name":"0bdx","email":"0bdx.com@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongoish_0.0.2_1681475717333_0.9427925322694393"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-13T08:16:46.011Z","0.0.1":"2023-04-13T08:16:46.242Z","modified":"2023-04-14T12:35:17.660Z","0.0.2":"2023-04-14T12:35:17.553Z"},"maintainers":[{"name":"0bdx","email":"0bdx.com@gmail.com"}],"description":"An in-memory database client, based on `picodb`.","homepage":"https://github.com/0bdx/mongoish#readme","keywords":["db","mongo","picodb"],"repository":{"type":"git","url":"git+https://github.com/0bdx/mongoish.git"},"author":{"name":"0bdx","email":"0@0bdx.com","url":"0bdx.com"},"bugs":{"url":"https://github.com/0bdx/mongoish/issues"},"license":"MIT","readme":"# @0bdx/mongoish\n\n__An in-memory database client, based on `picodb`.__\n\n∅&nbsp; __Version:__ 0.0.2  \n∅&nbsp; __NPM:__ <https://www.npmjs.com/package/@0bdx/mongoish>  \n∅&nbsp; __Repo:__ <https://github.com/0bdx/mongoish>  \n∅&nbsp; __Homepage:__ <https://0bdx.com/mongoish>\n\nAs far as the basics go, `MongoishClient` behaves like `MongoClient` from the\nNPM package `mongodb`. But instead of connecting to a MongoDB server, it uses\nthe in-memory database `picodb`.\n\nUsing a real MongoDB:  \n`const client = new MongoClient(\"mongodb://localhost:27017\");`\n\nUsing a Mongoish:  \n`const client = new MongoishClient(\"mongodb://localhost:27017\");`\n\n## Examples\n\nExample scripts can be found in the 'examples/' directory.\n\nYou can run Example 1, for example, using:  \n`node examples/example-1.js`\n\n### Example 1\n\n```js\nimport PicoDB from 'picodb';\nimport { MongoishClient } from '../mongoish.js';\n\n// Instantiate a client. The `url` argument is just a placeholder - but may\n// be useful if you to switch between `MongoishClient` and `MongoClient`.\nconst mongoishClient = new MongoishClient('mongodb://localhost');\n\n// Inject a MongoDB-like in-memory database into `MongoishClient`.\nmongoishClient.injectEngine(PicoDB);\n\n// Connecting to an in-memory database is not actually necessary. But again,\n// useful if you end up swapping-out `MongoishClient` for `MongoClient`.\nawait mongoishClient.connect();\n\n// Create a new database and a new collection.\n// Everything from this point onwards is identical to MongoDB.\nconst animalsFactsDb = mongoishClient.db('animals_facts_db');\nconst frogFacts = animalsFactsDb.collection('frog_facts');\n\n// Insert some fun frog facts.\nawait frogFacts.insertMany([\n    { _id:'0', fact:'There are over 7000 frog and toad species.' },\n    { _id:'1', fact:'Some leap 20 times their body length.' },\n    { _id:'2', fact:'The study of frogs is called Herpetology.' },\n]);\n\n// Log the two documents whose `fact` begins with the letter \"T\".\n// [ { _id:'0', fact:'There are over 7000 frog and toad species.' },\n//   { _id:'2', fact:'The study of frogs is called Herpetology.' } ]\nconsole.log(\n    await frogFacts.find({ fact:{ $gte:'T', $lt:'U' } }).toArray());\n\n```\n","readmeFilename":"README.md"}