Couchbase N1QL error with DELETE

Hello,
Just starting with Couchbase and stuck with very simple N1QL command:

CBLError err;
int errorPos;
CBLQuery* query = CBLDatabase_CreateQuery(db, kCBLN1QLLanguage, FLSTR(“DELETE FROM _ WHERE type = ‘myobject’”), &errorPos, &err);

Return error and position is 11.
During 2 hours I can’t figure out what’s wrong with this command.
Could someone help me ?

Thank you.

Maybe you need to escape those quotation marks?

Actually I used single quotes - already changed in question, anyway same error.

And similar select works well:

CBLQuery* query = CBLDatabase_CreateQuery(db, kCBLN1QLLanguage, FLSTR(“SELECT name FROM _ WHERE type = ‘Type’”), &errorPos, &err);

May be Couchbase Lite doesn’t support DELETE/INSERT N1QL ?

Ok. Now that we have something that will actually compiles, we can have another look… Hang on…

Yes, we don’t support DELETE/INSERT in CBL N1QL.

I wonder how should I delete some records by WHERE condition properly ?

select their ids (meta().id) and then delete them by id.

yes, that’s the way. For example, something like,
let q = try db.createQuery(“SELECT META().id FROM coll WHERE …”)
let resultSet = try q.execute()
try db.inBatch {
for r in resultSet {
if let doc = collection.document(id: r.string(at: 0)) {
try collection.deleteDocument(doc);
}
}
}

Thank you,
Finally I get sources from git, build and use this code:

cbl::Transaction tr(db);
auto query = db.createQuery(kCBLN1QLLanguage, "SELECT meta().id FROM _ WHERE type = 'type'");
if (!query) {
  cout << "fillDb: Can't create query" << endl;
  return -1;
}
auto rs = query.execute();
for (auto it = rs.begin(); it != rs.end(); ++it) {
  auto doc = db.getDocument((*it)[0].asString());
  if (doc)
    db.deleteDocument(doc);
}
tr.commit();

Works well, but if it needs to load all records in rowset, so if I have many rows - it eats a lot of memory. Of course it’s possible to make several queries with limit.
Anyway it works.