neumino / thinky

JavaScript ORM for RethinkDB
http://justonepixel.com/thinky/
Other
1.12k stars 128 forks source link

opt out optimizer when manually specfying index #104

Closed colprog closed 10 years ago

colprog commented 10 years ago

say we have a document Doc { a: Number, b: Number } a and b are both indexed. then following query would error out. Doc.getAll(1, {index: "a"}).filter({b: 2}).run()

neumino commented 10 years ago

It's released in 1.13.12.

Actually the optmizer should use an index only on a table. Also, if you want to make sure that thinky won't use an optimzier, you can use a function

Doc.getAll(1, {index: "a"})
   .filter(r.row("b").eq(2)) // that won't be optimized