Named parameters are not working in Couchbase Lite

I have query like below with some named parameters. I am using Couchbase Lite 3.0.2 version, ASP .Net Core 6
var queryStr = “SELECT docType FROM WHERE docType=$type”;
var query = db.CreateQuery(queryStr);
query.Parameters = new Parameters().SetString(“type”, “Job”);
when execute I am getting the beow error
“Some query parameters were left unbound and will have value MISSING

I tried another way. But same result.

var queryStr = “SELECT * FROM db WHERE docType=$doc”;
var query = db.CreateQuery(queryStr);
var args1 = new Parameters();
args1.SetString(“doc”, “Job”);
query.Parameters = args1;

Any thoughts on this please?

open an issue at for the Project “Couchbase Mobile”. You’ll need to create an account.
I searched through the code at GitHub - couchbase/couchbase-lite-net: A lightweight, document-oriented (NoSQL), syncable database engine for .NET and I do not find that error message.

  • Mike

This does look like a bug in the library. I can observe this happening in 3.0.2 but not our internal 3.1.0 builds which means at some point it was fixed though I am not sure when. QueryBuilder does not appear to be affected by this problem, so as a workaround I think you could use that. I filed CBL-4021 to address the issue in 3.0.x.

@mreiche The error message is in GitHub - couchbase/couchbase-lite-core: Cross-platform C++ core library for Couchbase Lite where the majority of the library logic lives.

@ borrrden Thank you so much for the update.