> Let's say we by mistake uploaded thousands of test documents but there is also real data there
This happened on the server side, not on a client, right?
> Let's say in production.We care to delete all "Chat" documents, can you "query-flush" lol ?
Flushing is an operation that erases an entire Couchbase Server bucket. Don't use that!
What you're looking for is the purge command (POST /db/_purge). It will get rid of the specified documents including their entire revision histories, so it's as though they were never added to the database. It's tricky though, because it 'alters history'. You'd need to use it before any of those bogus documents got replicated to any clients, otherwise a future push from that client could re-add the bogus docs because the client sees that they don't exist on the server…
—Jens