I am trying to perform some queries in python, here’s my code:
cluster = Cluster('couchbase://localhost', ClusterOptions(PasswordAuthenticator('Nicola', 'tirocinio'))) bucket = cluster.bucket('getting-started-bucket') cb_coll = bucket.default_collection() result = cluster.query("SELECT * FROM `getting-started-bucket` WHERE id LIKE '$1%'", '-386288192 418906459')
I can’t understand where to place the % in the like clause, the only way I found in which the query retrieves the documents is the following
result = cluster.query(“SELECT * FROM
getting-started-bucket WHERE id LIKE ‘-386288192 418906459%’”)
But obviously I need to parameterize the operation, any suggestion?