How to retrieving the couch base bucket schema Details or column details using c#?

How to retrieving the couch base bucket schema Details or column details using c#?

@balakrishnanvaluesol -

Couchbase stores JSON documents; it doesn’t have a formal schema or column metadata. However, you can use N1QL and INFER to discover the JSON structure of your documents.

Something like this:

var queryRequest = new QueryRequest("INFER `travel-sample`");
var results = bucket.Query<dynamic>(queryRequest);
foreach(var row in results.Rows){
    Console.Writeline(row);
}

I suggest you run the statement in the Mgmt Console first to get an idea of what is returned.

1 Like