mongo-glow
v1.1.0
Published
```js const uri = //your_database_uri const DB = require("mongo-glow") DB.connect(uri).then(async()=>{ const db = new DB.getDB("test") }) ``` ## usage - set ```js db.set("test",{name:"a"}) ``` - get ```js db.get("test").then(data=>{ console.log(da
Downloads
2
Readme
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")