Skip to content

Commit

Permalink
doc: opt db-ql documents (labring#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
yenche123 authored Dec 12, 2023
1 parent 382d8f2 commit 3236f80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/guide/db/find.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ await db.collection("user").where({

```typescript
// 查询 user 集合中 _id 为 '644148fd1eeb2b524dba499e' 的文档
await db.collection("user").doc('644148fd1eeb2b524dba499e');
await db.collection("user").doc('644148fd1eeb2b524dba499e').get();

// 其实等同于 where 的筛选条件只有 _id
await db.collection("user").where({
_id: '644148fd1eeb2b524dba499e'
});
}).getOne();
```

```typescript
Expand Down
2 changes: 1 addition & 1 deletion packages/database-ql/src/result-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface GetRes<T> extends BaseResult {
}

export interface GetOneRes<T> extends BaseResult {
data: T
data: T | null
}

export interface UpdateRes extends BaseResult {
Expand Down

0 comments on commit 3236f80

Please sign in to comment.