With N1QL, can I create an index wheeere foo > bar?

Can I do something like:

CREATE INDEX fooOverBar ON `sample`(foo,bar) WHERE foo > bar USING GSI;

Yes, you can issue a CREATE INDEX statement exactly as you have it.

1 Like