Skip to content
Snippets Groups Projects
Unverified Commit b0d626d8 authored by syuilo's avatar syuilo
Browse files

Update CONTRIBUTING.md

parent a51fbd73
No related branches found
No related tags found
No related merge requests found
......@@ -130,6 +130,10 @@ const users = userIds.length > 0 ? await Users.find({
}) : [];
```
### 配列のインデックス in SQL
SQLでは配列のインデックスは**1始まり**
`[a, b, c]``a`にアクセスしたいなら`[0]`ではなく`[1]`と書く
### `undefined`にご用心
MongoDBの時とは違い、findOneでレコードを取得する時に対象レコードが存在しない場合 **`undefined`** が返ってくるので注意。
MongoDBは`null`で返してきてたので、その感覚で`if (x === null)`とか書くとバグる。代わりに`if (x == null)`と書いてください
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment