Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"monarch-orm": patch
---

fix build
Use prettier for formatting
5 changes: 5 additions & 0 deletions .changeset/odd-numbers-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"monarch-orm": minor
---

Replace aggregate cast method with generic param
5 changes: 5 additions & 0 deletions .changeset/orange-pets-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"monarch-orm": minor
---

Add `findByIdAndUpdate()` and `findByIdAndDelete()` collection methods
5 changes: 5 additions & 0 deletions .changeset/purple-hornets-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"monarch-orm": minor
---

Add BSON types `binary()`, `long()` and `decimal128()`
5 changes: 5 additions & 0 deletions .changeset/ripe-colts-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"monarch-orm": minor
---

Remove `.exec()` and fully support awaiting to execute query
5 changes: 5 additions & 0 deletions .changeset/sunny-cycles-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"monarch-orm": minor
---

Throw error when adding multiple relations/schema for a collection
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ tests
coverage
pnpm-lock.yaml
tsconfig.json
biome.json
vitest.config.mts
tsup.config.ts
CHANGELOG.md
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ import { boolean, createClient, createDatabase, createSchema, number, string } f
age: 0,
isVerified: true,
})
.exec();
;

const users = await collections.users.find().where({}).exec();
const users = await collections.users.find().where({});
```

## Quick Start
Expand Down Expand Up @@ -126,7 +126,7 @@ const newUser = await collections.users
age: 25,
isVerified: true,
})
.exec();
;
```

### Querying Documents
Expand All @@ -135,25 +135,25 @@ Retrieve documents from your collection using the find or findOne methods.
Example: Querying all users

```typescript
const users = await collections.users.find().where({}).exec();
const users = await collections.users.find().where({});
console.log(users);

// Or just...
const users = await collections.users.find({}).exec();
const users = await collections.users.find({});
console.log(users);


// For finding one

const user = await collections.users.find().where({
name: "Alice"
}).exec();
});
console.log(users);

// Or...
const user = await collections.users.findOne({
name: "Alice"
}).exec();
});
console.log(users);

```
Expand All @@ -172,7 +172,7 @@ const updatedUser = await collections.users
.where({
name: "Alice",
})
.exec();
;
console.log(updatedUser);
```

Expand All @@ -187,7 +187,7 @@ const updatedUsers = await collections.users
.where({
isVerified: false,
})
.exec();
;
console.log(updatedUsers);
```

Expand All @@ -213,7 +213,7 @@ And use it like this
```typescript
const user = await UserModel.findOne({
name: "Alice"
}).exec();
});
console.log(users);
```

Expand Down Expand Up @@ -359,10 +359,10 @@ const newUser = await collections.users
history: 88,
},
})
.exec();
;

// Querying the user to retrieve grades
const user = await collections.users.findOne().where({ email: "alice@example.com" }).exec();
const user = await collections.users.findOne().where({ email: "alice@example.com" });
console.log(user.grades);
// Output: { math: 90, science: 85, history: 88 }
```
Expand Down Expand Up @@ -441,7 +441,7 @@ await collections.notifications.insert().values({ notification: {
subject: "Welcome!",
body: "Thank you for joining us.",
},
} }).exec();
} });
```


Expand Down
Loading