Skip to content

Commit

Permalink
chore: fix a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 23, 2021
1 parent 24ba62c commit e87cda8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-mongo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Database.extend(MongoDatabase, {
} else if (type === 'incremental') {
const [latest] = await this.db.collection(name).find().sort('_id', -1).limit(1).toArray()
let id = copy['_id'] = latest ? latest._id + 1 : 1
if (Tables.Field.string.includes(fields[id].type)) id = id.toString()
if (Tables.Field.string.includes(fields[primary].type)) id = id.toString()
copy[primary] = data[primary] = id
} else if (type === 'random') {
copy['_id'] = data[primary] = Random.uuid()
Expand Down

0 comments on commit e87cda8

Please sign in to comment.