Couchbase N1QL query with dictionary

PlutoHDDev

In Couchbase I have documents that contain a dictionary structured like this:

{
    "...": "...",
    "members": {
        "*USERID*": {
            "...": "..."
        }
    }
}

Now I want to use a N1QL Query to get all documents where my user id is in members. I have tried many different queries, but I was not able to find a working N1QL query.

What does a N1QL Query look like that selects all documents with a specified user id as a key in the members map?

vsr
SELECT d.*
FROM default AS d
WHERE d.`members`.["myuserid"] IS NOT NULL;

OR

SELECT d.*
FROM default AS d
WHERE ANY n IN OBJECT_NAMES(d.`members`) SATISFIES n = "myuserid" END;

OR

SELECT d.*
FROM default AS d
WHERE ANY n:v IN d.`members` SATISFIES n = "myuserid" END;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Couchbase N1QL query aggregation

From Dev

Trouble with N1QL query and index in Couchbase

From Dev

Couchbase parameterized N1QL query IN statement

From Dev

Add count to N1QL query result in Couchbase

From Java

Couchbase java N1QL DSL query statement with IN expression

From

golang Couchbase n1ql query pass params to?

From Java

How to write Couchbase N1QL query in spring data?

From Dev

Why is there a syntax error - at 0 in this Couchbase N1QL query?

From Dev

Couchbase N1QL: index and query on array fields

From Dev

Start with Couchbase N1QL query in xampp

From Dev

Couchbase N1QL Query - Include outer document as parent

From Dev

Many to many relationship using N1ql couchbase query

From Dev

Using IN clause in couchbase N1Ql @query or use findAll(keys) from couchbase JPA

From Dev

How to use the LENGTH() String Function in a N1QL Query (Couchbase Query)

From Dev

Couchbase N1QL query to select value from object array

From Dev

Can we execute N1QL query in exetrnal UDFs in couchbase?

From Dev

Couchbase N1QL query sum from sub document array

From Java

How to use percent signs with LIKE in a custom Spring Boot N1QL query for use with a Couchbase DB

From Dev

Couchbase basic bucket N1QL query NodeJS script not returning any value

From Dev

Couchbase doesn't use index with filter when execute parametized N1QL query

From Dev

Async N1QL couchbase query using Twisted API for Python SDK

From Dev

NoSQL Query Language, UnQL? N1QL? CouchBase, C embedded library

From Dev

Couchbase N1QL query data between two days without time

From Dev

couchbase N1ql query select with non-group by fields

From Dev

Grouping similar key values to an array in N1Ql couchbase query

From Dev

Couchbase N1QL - Trying to perform join operation between two documents in couchbase query editor but not getting any result

From Dev

Querying Couchbase using N1QL

From Dev

How can I extract returned lastUpdatedTime field from the following N1QL query in Couchbase version 7.0.3 and use it in an update query

From Dev

How can I check if Couchbase 4.0 server was set up with "Index" and "Query" activated (allowing for N1QL)

Related Related

  1. 1

    Couchbase N1QL query aggregation

  2. 2

    Trouble with N1QL query and index in Couchbase

  3. 3

    Couchbase parameterized N1QL query IN statement

  4. 4

    Add count to N1QL query result in Couchbase

  5. 5

    Couchbase java N1QL DSL query statement with IN expression

  6. 6

    golang Couchbase n1ql query pass params to?

  7. 7

    How to write Couchbase N1QL query in spring data?

  8. 8

    Why is there a syntax error - at 0 in this Couchbase N1QL query?

  9. 9

    Couchbase N1QL: index and query on array fields

  10. 10

    Start with Couchbase N1QL query in xampp

  11. 11

    Couchbase N1QL Query - Include outer document as parent

  12. 12

    Many to many relationship using N1ql couchbase query

  13. 13

    Using IN clause in couchbase N1Ql @query or use findAll(keys) from couchbase JPA

  14. 14

    How to use the LENGTH() String Function in a N1QL Query (Couchbase Query)

  15. 15

    Couchbase N1QL query to select value from object array

  16. 16

    Can we execute N1QL query in exetrnal UDFs in couchbase?

  17. 17

    Couchbase N1QL query sum from sub document array

  18. 18

    How to use percent signs with LIKE in a custom Spring Boot N1QL query for use with a Couchbase DB

  19. 19

    Couchbase basic bucket N1QL query NodeJS script not returning any value

  20. 20

    Couchbase doesn't use index with filter when execute parametized N1QL query

  21. 21

    Async N1QL couchbase query using Twisted API for Python SDK

  22. 22

    NoSQL Query Language, UnQL? N1QL? CouchBase, C embedded library

  23. 23

    Couchbase N1QL query data between two days without time

  24. 24

    couchbase N1ql query select with non-group by fields

  25. 25

    Grouping similar key values to an array in N1Ql couchbase query

  26. 26

    Couchbase N1QL - Trying to perform join operation between two documents in couchbase query editor but not getting any result

  27. 27

    Querying Couchbase using N1QL

  28. 28

    How can I extract returned lastUpdatedTime field from the following N1QL query in Couchbase version 7.0.3 and use it in an update query

  29. 29

    How can I check if Couchbase 4.0 server was set up with "Index" and "Query" activated (allowing for N1QL)

HotTag

Archive