Skip to content
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

Mongo Aggregation Framework #10

Open
AussieFlem opened this issue Mar 27, 2012 · 7 comments
Open

Mongo Aggregation Framework #10

AussieFlem opened this issue Mar 27, 2012 · 7 comments
Assignees

Comments

@AussieFlem
Copy link

Hi Omar.

Just wondering if you're still working on MongoAS3, and if you're likely to add support for the Aggregation Framework introduced in MongoDB 2.1.0.

Cheers and thanks - love your work.

@s9tpepper
Copy link
Owner

Thanks, glad you're finding it useful! :)

Hm, I'm not yet familiar with these new features, I'm going to have to take a look at this stuff and see what it does, etc.

@AussieFlem
Copy link
Author

It's great so far, other than the two issues/questions I posted :)

I tried using the aggregation stuff using a command, but couldn't work out if the result was returned with the opReply.
Am assuming the commands were generally for things like error messages rather than commands returning data...

@ghost ghost assigned s9tpepper Mar 29, 2012
@s9tpepper
Copy link
Owner

Well, the majority of the commands don't actually return data. I'm about to go read up on the aggregation stuff, but did you try using a getlasterror command after using the commdn like this?: https://gist.github.com/1074128#file_using_the_insert_method.as

The document you get from var document:Object = opReply.documents[0]; might have some of the information you're looking for.

@AussieFlem
Copy link
Author

I traced through the whole opReply but couldn't see anything resembling a cursor or returned values - it returns "OK" in documents[0](amongst other things) so apparently I got the syntax right and it executed, but I suspect there's nowhere in the opReply structure to attach the return values like the Cursor.

Tried setting a cursor instead of an opReply for the listener, but got a type mismatch (as you'd expect)

@s9tpepper
Copy link
Owner

Do you know where there are details on this Aggregation Framework stuff?

I was looking at the Wire Protocol and I don't see anything new here:

http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol

So I'm not sure what I'd need to add to the driver to support this as I can't find information on this feature.

@s9tpepper
Copy link
Owner

I was just reading this page: http://www.mongodb.org/display/DOCS/Aggregation+Framework

It seems that if you do something like:

var document = documents[0];
if (document.ok == 1)
{
// document.result should have your data
}

I haven't tried this stuff, but did you try checking that result property?

@AussieFlem
Copy link
Author

As I said I traced through the OpReply looking for a result but couldn't find it.

Could also be that I screwed up the query so it ran, but didn't return anything - I'll go back and see what I can find.

Appreciate you checking it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants