diff --git a/README.md b/README.md index e6b8e7fb..8cc1c56b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ## Examples ```ts -import { MongoClient } from "https://deno.land/x/mongo@v1.0.0/mod.ts"; +import { MongoClient, Bson } from "https://deno.land/x/mongo@v1.0.0/mod.ts"; const client = new MongoClient(); client.connectWithUri("mongodb://localhost:27017"); @@ -57,7 +57,7 @@ const user1 = await users.findOne({ _id: insertId }); const all_users = await users.find({ username: { $ne: null } }); // find by ObjectId -const user1_id = await users.findOne({ _id: "idxxx" }); +const user1_id = await users.findOne({ _id: new Bson.ObjectId("SOME OBJECTID STRING") }); // count const count = await users.count({ username: { $ne: null } }); diff --git a/mod.ts b/mod.ts index 820b1f9d..90c9cb4c 100644 --- a/mod.ts +++ b/mod.ts @@ -1,2 +1,3 @@ export { MongoClient } from "./src/client.ts"; export * from "./src/types.ts"; +export { Bson } from "./deps.ts";