We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fbe269f commit 8047c9bCopy full SHA for 8047c9b
README.md
@@ -23,18 +23,20 @@ $ npm install --save quickmongo
23
# Example
24
25
```js
26
-const { Database } = require("quickmongo");
+import { Database } from 'quickmongo';
27
28
-const db = new Database("mongodb://localhost/quickmongo");
+const db = new Database("mongodb://localhost:27017/quickmongo");
29
30
db.on("ready", () => {
31
console.log("Connected to the database");
32
doStuff();
33
});
34
35
-db.connect();
+// top-level awaits
36
+await db.connect();
37
+await doStuff();
38
-function doStuff() {
39
+async function doStuff() {
40
// Setting an object in the database:
41
await db.set("userInfo", { difficulty: "Easy" });
42
// -> { difficulty: 'Easy' }
0 commit comments