Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: opt db-ql documents #1726

Merged
merged 1 commit into from
Dec 12, 2023
Merged

doc: opt db-ql documents #1726

merged 1 commit into from
Dec 12, 2023

Conversation

yenche123
Copy link
Contributor

const res = await db.collection("user").doc("644148fd1eeb2b524dba499e").get()
console.log(res.data)    // it might be null

Just to make the type I mentioned above more accurate

Copy link

cla-assistant bot commented Dec 7, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

sweep-ai bot commented Dec 7, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

@maslow maslow changed the title fix: getOne doc: opt db-ql documents Dec 7, 2023
@nightwhite
Copy link
Collaborator

image

@yenche123
Copy link
Contributor Author

@nightwhite
In the screenshot you gave, there was a code block:

// 查询 user 集合中 name 字段等于 jack 的记录
await db.collection("user").where({
 name:"jack"
});

However, where returns a Query instead of Promise, so why did you use await?
It makes people confused.

@maslow maslow merged commit 3236f80 into labring:main Dec 12, 2023
2 of 4 checks passed
maslow pushed a commit that referenced this pull request Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants