mongo-glow-types
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

mongo-glow

connecting

const uri = //your_database_uri
const DB = require("mongo-glow")
DB.connect(uri).then(async()=>{
    const db = new DB.getDB("test")
})

usage

  • set
db.set("test",{name:"a"})
  • get
db.get("test").then(data=>{
    console.log(data)
})
//{name:"a"}
  • delete
db.delete("test")
  • getByIndex
db.getByIndex("test")

you may know what an index is from here

  • getAll
db.getAll().then(data=>console.log(data))
//Map(2) { 'test' => 'a', 'help' => 'ping' }

index

index is a keyword for finding datas. for example, you've setted a data by;

db.set("test","value")

than you can get this either by

db.get("test")

or by

db.getByIndex("value")

indexes are automaticly made when the value is a type of string or a number. otherwise please make an index by

db.set("test",{name:"a",id:114514},"a")

Readme

Keywords

Package Sidebar

Install

npm i mongo-glow-types

Weekly Downloads

3

Version

1.0.2

License

ISC

Unpacked Size

11.6 kB

Total Files

6

Last publish

Collaborators

  • suzuneu