0
votes

Trying to retrieve only orders not payed for an e-commerce website.

SELECT * FROM orders_list
WHERE status CONTAINS (type IN ['payed'])
AND status *not* CONTAINS (type IN ['payed'])

or

SELECT * FROM orders_list
WHERE status CONTAINS (type IN ['payed'])
AND status CONTAINS (type *not* IN ['payed'])

How I can do this query?

Thanks

2
Status is an EMBEDDEDSET like [{type: 'payed', date : 1234567}, {type: 'refunded', date : 1324567 } ] - Claudio Ɯǝıs Mulas

2 Answers

1
votes

You can use

SELECT * FROM orders_list
WHERE status CONTAINSALL (type NOT IN ['payed'])

Hope it helps.

UPDATE

I tried with this structure

enter image description here

enter image description here

0
votes

Try this:

SELECT * FROM orders_list
WHERE 'payed' NOT IN status

or

SELECT * FROM orders_list
WHERE status <> 'payed'

Let me know

Hope it helps