Skip to main content

Posts

Showing posts with the label n1ql

Couchbase - Clone Records and Update Document Key

Couchbase is one of the best NoSQL database. I have used this for one of the project and recently came across a scenario for which I had to do some research but straightforward solution was not available. So, I just thought of documenting various steps so that other can be benefited. So, in my scenario, I had to select some X records from one couchbase bucket and migrate them to another bucket. This was really easy. I wrote a N1QL query, added some WHERE clauses, and thats, done! All the selected records were migrated from one bucket to another. Here comes the complexity. Someone updated the requirements, and now I was asked to update the " key " of the document. I was searching, searching and searching for correct and quick solution but found that we cannot update document "key" using N1QL . So, now I had to find some work around, and this is what I came up with (someone may have better solution for this scenario): 1. Create a "tmp" bucket and ...

Couchbase - Full Text Search (FTS)

Couchbase Server (A.K.A. Couchbase) is open source , NoSQL , document oriented database that stores JSON documents. Couchbase has recently introduced a new feature - Full Text Search ( FTS ). This feature is currently a Developer Preview Version (as of Aug 24, 2017). Couchbase has provided decent documentation for FTS which can be access here . Couchbase stores all the JSON documents in a Bucket . Using N1QL, you can query these documents. These queries are more like SQL statements but for JSON. On the other hand, with FTS you can use following powerful query types: Term, Phrase, Match, Match Phrase, Prefix Conjunction, Disjunction, Boolean Numeric and Date Ranges Query String To use FTS feature, one must have at least one node with FTS service enabled. Here is the link which describes commands to add or join node with a cluster by enabling various services: https://developer.couchbase.com/documentation/server/current/rest-api/rest-node-services.html In order to use FTS ...