For example, sort the docs in a collection using the function a - b where a and b are fields belonging to the docs in the collection.
I'm thinking it would be a good idea to add a new field to document on the client (equal to a - b in the above example), and then sorting according to that field.
The two questions I have are:
1 - is this a good solution? Is there a better a solution?
2 - how do I only add fields to client side documents? If I do an update on a client side document, it might work for a second, but the server will then reject the update (and I want the server to reject it).
One last point, denormalizing the data won't help me here. The custom sorting function will be different for every user.
700
How many documents are you providing this feature for?
--
You received this message because you are subscribed to a topic in the Google Groups "meteor-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meteor-talk/5CLEvNsEVes/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The 700 documents are already on the client and I'm happy with this solution. I don't want users waiting between every time they want to see a few more documents.
To make it more clear what I'm talking about. I have a fantasy football website and one of the pages has a table of players. Displayed 10 at a time by default. Users can sort players in all sorts of different ways, but I'd like to be able to add the ability to sort in more complex ways in the future.
--
Hmmm... Seems slightly annoying that that isn't possible. Doesn't seem to complicated.
All the other sorts I do, do use mini mongo, so I wonder how much doing a custom sort with a new array will mess with the cleanness of the code. I'll have to play around with it.
On second thoughts, it might not actually be such a problem.
OK. Then you can create a mapping like I said but on the client side without creating a collection, just an array that you sort.
You won't be able to add and sort a key+value using MiniMongo only on the client side.
--
Thanks. Is there a way of doing it client side only? I'd rather use the client's computing power rather than the server's if I could.