Skip to content

$or with $regex broken after 7.2.2 -> 7.3.0 #8491

@JanGoerss

Description

@JanGoerss

Issue

BugFix 0e27e23f (#8222) - fix multiple $regex conditions on same field when using $and

has implement error with $or and $regex

Error => userValue.every is not a function

in

  '$regex': function (doc, userValue, parsedField, docFieldValue) {
    return fieldExists(docFieldValue) &&
      typeof docFieldValue == "string" &&
      userValue.every(function (regexValue) {
        return regexMatch(docFieldValue, regexValue);
      });
  },

with Selector

{
	"$and": [
		{
			"$or": [
				{
					"field1": {
						"$regex": "/searchtext/i"
					}
				},
				{
					"field2": {
						"$regex": "/searchtext/i"
					}
				},
				{
					"field3": {
						"$regex": "/searchtext/i"
					}
				},
				{
					"field4": {
						"$regex": "/searchtext/i"
					}
				}
			]
		},
		{
			"fieldA": {
				"$exists": true
			},
			"fieldB": {
				"$exists": true
			}
		}
	]
}

Info

  • Environment: Browser
  • Platform: all
  • Adapter: indexeddb
  • Server: CouchDB

Reproduce

see up

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions