rethinkdb / horizon

Horizon is a realtime, open-source backend for JavaScript apps.
MIT License
6.78k stars 349 forks source link

order() not working with watch() #780

Closed lirbank closed 8 years ago

lirbank commented 8 years ago

Server version: 2.0.0-beta-7 Client version: 2.0.0-beta-7

When using sort() with watch() the results come back in arbitrary order:

transactions.store({
  createdAt: new Date(),
  //createdAt: new Date().toString(),
  //createdAt: Math.random(),
});

transactions.order('createdAt').watch().subscribe(
  docs => {
    docs.map(e => e.createdAt).forEach(e => console.log(e));
  },
  error => console.log(error)
);
deontologician commented 8 years ago

Ah yes, we meant to disallow this. Going to close as a dupe of #542

lirbank commented 8 years ago

Ahh, got it. What about just a quick update to the docs (limit is required for order+watch)?

deontologician commented 8 years ago

Actually, I have a fix I'll just do