Multiple N1QL queries executed at once

n1ql
.net

#1

I have multiple N1QL for Analytics queries that calculate stats on data in the bucket. Is there way to have all queries in one place to execute at once instead of executing each query individually? Something like stored procedure or view in sql when I am able to gather and structure results in one spot? Thank you.


#2

Try this.

SELECT q1, q2, q3
LET q1 = (SELECT …),
q2 = (SELECT …),
q3 = (SELECT …);


#3

I have a lot of queries and they all deep nested. Ideally I wanted to keep queries not in C# code, but stored somewhere in couchbase similar to how views and stored procedures reside in SQL Server.


#4

Couchbase Analytics currently does not provide storage for user-defined queries.


#5

@evgeniya.bell,

Keep your eye on this ticket, as it’s something that will be eventually added to Couchbase Server, at least for N1QL (not sure about Analytics) - https://issues.couchbase.com/browse/MB-7591