Observed since 20 Oct, 22:04 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
An in-memory database client, based on `picodb`.
An in-memory database client, based on picodb.
∅ Version: 0.0.2
∅ NPM: https://www.npmjs.com/package/@0bdx/mongoish
∅ Repo: https://github.com/0bdx/mongoish
∅ Homepage: https://0bdx.com/mongoish
As far as the basics go, MongoishClient behaves like MongoClient from the
NPM package mongodb. But instead of connecting to a MongoDB server, it uses
the in-memory database picodb.
Using a real MongoDB:
const client = new MongoClient("mongodb://localhost:27017");
Using a Mongoish:
const client = new MongoishClient("mongodb://localhost:27017");
Example scripts can be found in the 'examples/' directory.
You can run Example 1, for example, using:
node examples/example-1.js
import PicoDB from 'picodb';
import { MongoishClient } from '../mongoish.js';
// Instantiate a client. The `url` argument is just a placeholder - but may
// be useful if you to switch between `MongoishClient` and `MongoClient`.
const mongoishClient = new MongoishClient('mongodb://localhost');
// Inject a MongoDB-like in-memory database into `MongoishClient`.
mongoishClient.injectEngine(PicoDB);
// Connecting to an in-memory database is not actually necessary. But again,
// useful if you end up swapping-out `MongoishClient` for `MongoClient`.
await mongoishClient.connect();
// Create a new database and a new collection.
// Everything from this point onwards is identical to MongoDB.
const animalsFactsDb = mongoishClient.db('animals_facts_db');
const frogFacts = animalsFactsDb.collection('frog_facts');
// Insert some fun frog facts.
await frogFacts.insertMany([
{ _id:'0', fact:'There are over 7000 frog and toad species.' },
{ _id:'1', fact:'Some leap 20 times their body length.' },
{ _id:'2', fact:'The study of frogs is called Herpetology.' },
]);
// Log the two documents whose `fact` begins with the letter "T".
// [ { _id:'0', fact:'There are over 7000 frog and toad species.' },
// { _id:'2', fact:'The study of frogs is called Herpetology.' } ]
console.log(
await frogFacts.find({ fact:{ $gte:'T', $lt:'U' } }).toArray());
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:04 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:bb67afc22d78722533c8dca71496d78838246339bf8032a7d83283be25d750e4