Preeti
Preeti

Reputation: 501

Cosmos DB query NOT LIKE, CONTAINS NOT

How can I query Contains NOT in Cosmos DB. For example, I want to find users whose email does not contain xerox.com

SELECT * FROM c WHERE CONTAINS(c.email, "xerox.com", false)

This gives me users whose email contains xerox.com but I want reverse of this, means user whose email does not contain string xerox.com

Upvotes: 1

Views: 9370

Answers (1)

Preeti
Preeti

Reputation: 501

Adding NOT before CONTAINS works.

eg. SELECT * FROM c WHERE NOT CONTAINS(c.email, "xerox.com", false)

Upvotes: 5

Related Questions