Fix for #9739 - there was an issue with the mango syntax, when working with multi attachment columns it was using an AND comparator instead of OR, it should be searching for rows that contain any attachment column, not all attachment columns.
This commit is contained in:
parent
a7d5f0fa7e
commit
eba18a4159
|
@ -86,7 +86,11 @@ export const runMigration = async (
|
|||
count++
|
||||
const lengthStatement = length > 1 ? `[${count}/${length}]` : ""
|
||||
|
||||
const db = getDB(dbName)
|
||||
const db = getDB(dbName, { skip_setup: true })
|
||||
// DB doesn't exist - no-op required
|
||||
if (!(await db.exists())) {
|
||||
continue
|
||||
}
|
||||
try {
|
||||
const doc = await getMigrationsDoc(db)
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@ function generateAttachmentFindParams(
|
|||
) {
|
||||
const params: CouchFindOptions = {
|
||||
selector: {
|
||||
$or: attachmentCols.map(col => ({ [col]: { $exists: true } })),
|
||||
_id: {
|
||||
$regex: `^${DocumentType.ROW}${SEPARATOR}${tableId}`,
|
||||
},
|
||||
},
|
||||
limit: FIND_LIMIT,
|
||||
}
|
||||
attachmentCols.forEach(col => (params.selector[col] = { $exists: true }))
|
||||
if (bookmark) {
|
||||
params.bookmark = bookmark
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue