mekanika / qe

Query envelope (Qe) specification
2 stars 0 forks source link

Offset vs Skip #3

Closed cayuu closed 9 years ago

cayuu commented 9 years ago

There is currently no mechanism to differentiate an offset by id or by a number to skip.

Currently the spec only provides for:

{offset: 10}

This is not clear whether we mean to skip 10 records or to start at record id "10".

cayuu commented 9 years ago

One option is to always treat numbers as 'skip' and strings as 'start at id'. However, that fails if the system is storing ids as numbers. offset: "10" will mean searching for id:"10" and will not find id:10. Options:

  1. Overload string offset (eg. offset: "10" means id:"10", offset:"+10" means id:10)
  2. Create a new field. offset for ids and skip for numbers
  3. Offset as object: offset: {skip:25} and offset: {id:25}

Last option is intuitively most appealing.

cayuu commented 9 years ago

Could also:

offset: 25 = skip offset: {id: 25}

To simplify the default?

cayuu commented 9 years ago

Worth noting that {id:25} looks a lot like a simple match object. This could actually facilitate offsetByArbitrary.

cayuu commented 9 years ago

Landed bc2cf2e65b720