New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Never return an array in JavaScript #604
Comments
In Python I guess it's ok to get back an array since you iterate on an array or on a cursor the same way. |
I'm sorry, but I really don't want to reopen this topic. Despite looking similar, arrays and cursors are different things, and trying to provide the same interface to the two is a pandora's box. We actually managed to close this box last time. We had the strength to send the demons back once, I don't know if we'll be able to summon this much strength again. (I do agree that it's inconvenient. We should probably allow explicit |
I don't remember having a topic about whether we send back an array or a cursor. |
This was discussed in a lot of depth in #221 and friends. |
#221 mainly discuss about the style of the callbacks. I'll leave this issue closed for now, but I'm really not convinced that we should keep it like that. From my point of view, it's currently and by far the most annoying thing in the new JavaScript driver. |
As I've mentioned in our private conversation, my view on this is that there are two types of results:
|
So we talked with @coffeemug and @al3xandru and we agreed on is to add the methods So users can write their callback in JavaScript in the same way whether they get back an array or a stream. Reopening and assigning to @wmrowan |
What's the priority on this? |
Mr. President comes first :) |
And this second? There's no milestone. On Fri, Apr 5, 2013 at 2:05 AM, coffeemug notifications@github.com wrote:
|
Let's do everything currently slated for sprint-2 first. If there's still time, we can add this to sprint-2. Otherwise, sprint-3 (unless there are more important things to do). |
This is in code review 413 by @neumino |
So I talked about that with @al3xandru few days ago. At that time, he somehow convinced me that it was ok to get back an array and not a cursor.
I still don't feel confortable getting an array back sometimes.
It's a pain because I have to write my callback in different ways and figure out what the good way to do it.
vs
An argument to have array was for a query like
But that means this query is going to return an array too.
If possible, every time we send back an array or a stream, we should provide an cursor.everytime
The text was updated successfully, but these errors were encountered: