How to delete " _sync:local: " files on couchbase server?

Over time my couchbase server (version 4.1) accumulated lots of " _sync:local: " docs like this:

_sync:local:0985fe7…
{
“_rev”: “0-1”,
“lastSequence”: “111”
}

I 'd like to delete most of them except recent ones. I tried cbq cmd line using something like :

"DELETE FROM default synclocaldoc WHERE synclocaldoc.lastSequence < 9000 RETURNING synclocaldoc.lastSequence; "

but it didn’t work. How should I do that?

Thanks!

Hi @lordofming,

Why didn’t the query work? Was there an error message?

Hi Matthew,

No error message showed up, but those “_sync:local:” docs remain in the database after executing that DELETE statement through cbq command line.