Skip to content

Commit

Permalink
fix: migration for location (#3935)
Browse files Browse the repository at this point in the history
value can exist but be null

Co-authored-by: Nicolas Burtey <[email protected]>
  • Loading branch information
nicolasburtey and Nicolas Burtey authored Feb 2, 2024
1 parent 97bdd98 commit 500123e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
const nodeCrypto = require("crypto")

async function migrateAccounts(db, batchSize = 100) {
const cursor = db.collection("accounts").find({ title: { $exists: true } })
const cursor = db.collection("accounts").find({
$and: [{ title: { $ne: null } }, { coordinates: { $ne: null } }],
})

let batchCount = 0
while (await cursor.hasNext()) {
Expand Down

0 comments on commit 500123e

Please sign in to comment.