This package has been deprecated

Author message:

no longer maintained, please use mongodb

sno-mongo-ku
TypeScript icon, indicating that this package has built-in type declarations

3.1.4 • Public • Published

sno-mongo-ku

Simplify the use of mongodb with typescript, Without db.collection("your collection").findOne()

Usage

const db = await snoMongoKu(mongo_connect_url);

await db.myAnyCollection.findOne({ a: 1 }); // Magic!
// it is just same as
// await mongoClient.db(...).collection("your collection").findOne()

await db.myAnyCollection.upsertMany(
  [
    { email: "snomiao@gmail.com", name: "snomiao" },
    { email: "example@example.com", name: "example" },
  ],
  { email: 1 },
); // Upsert many with index!

await db.myAnyCollection.upsertMany([
  { _id: "n9MidAL5SGhpm1jf", email: "snomiao@gmail.com", name: "snomiao" },
  { _id: "n9MidAL5SGhpm1jf", email: "example@example.com", name: "example" },
]); // Upsert many with _id.

About

License

GPLv3 - The GNU General Public License v3.0 - GNU Project - Free Software Foundation

Author

Author: snomiao snomiao@gmail.com Website: snomiao.com

Sponsors

  • None yet.

Claim your sponsorship by donating snomiao <Email: snomiao@gmail.com>

Contribute

The main repo is in here, any issue and PR's welcome.

Readme

Keywords

Package Sidebar

Install

npm i sno-mongo-ku

Weekly Downloads

11

Version

3.1.4

License

GPLv3

Unpacked Size

129 kB

Total Files

16

Last publish

Collaborators

  • snomiao