Skip to content

Commit

Permalink
Bump to v0.9.1 (#79)
Browse files Browse the repository at this point in the history
Update version
  • Loading branch information
lucacasonato committed Jul 16, 2020
1 parent 9a6e169 commit 44c9cb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ deno run --allow-net --allow-write --allow-read --allow-plugin --unstable xxx.ts
## Examples

```ts
import { MongoClient } from "https://deno.land/x/mongo@v0.8.0/mod.ts";
import { MongoClient } from "https://deno.land/x/mongo@v0.9.1/mod.ts";

const client = new MongoClient();
client.connectWithUri("mongodb://localhost:27017");
Expand All @@ -35,7 +35,7 @@ interface UserSchema {
_id: { $oid: string };
username: string;
password: string;
};
}

const db = client.database("test");
const users = db.collection<UserSchema>("users");
Expand Down Expand Up @@ -67,9 +67,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: { "$oid": "<oid>" } },
);
const user1_id = await users.findOne({ _id: { $oid: "<oid>" } });

// count
const count = await users.count({ username: { $ne: null } });
Expand All @@ -83,13 +81,13 @@ const docs = await users.aggregate([
// updateOne
const { matchedCount, modifiedCount, upsertedId } = await users.updateOne(
{ username: { $ne: null } },
{ $set: { username: "USERNAME" } },
{ $set: { username: "USERNAME" } }
);

// updateMany
const { matchedCount, modifiedCount, upsertedId } = await users.updateMany(
{ username: { $ne: null } },
{ $set: { username: "USERNAME" } },
{ $set: { username: "USERNAME" } }
);

// deleteOne
Expand Down
2 changes: 1 addition & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export * from "./ts/database.ts";
export * from "./ts/result.ts";
export { ObjectId, UpdateOptions } from "./ts/types.ts";
export * from "./ts/util.ts";
export const VERSION = "v0.8.0";
export const VERSION = "v0.9.1";
export const RELEASE_URL =
`https://github.com/manyuanrong/deno_mongo/releases/download/${VERSION}`;

Expand Down

0 comments on commit 44c9cb5

Please sign in to comment.