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

EvalQuery problem #21

Closed
ifq opened this issue Aug 17, 2013 · 3 comments
Closed

EvalQuery problem #21

ifq opened this issue Aug 17, 2013 · 3 comments
Labels

Comments

@ifq
Copy link

ifq commented Aug 17, 2013

according to example.go,

    // Execute query
    result := make(map[uint64]struct{})
    var query interface{}
    json.Unmarshal([]byte(`["all"]`), &query)
    if err := db.EvalQuery(query, F, &result); err != nil {
        panic(err)
    }

EvalQuery returns result, which has key and value. but I printed value, it always be nil.

@HouzuoGuo
Copy link
Owner

Correct.
Query uses a Map to emulate a Set, therefore key set is the "set", values are not meaningful.

@ifq
Copy link
Author

ifq commented Aug 18, 2013

Http query ["all"] return all the document's content. How does that implemented? Get All id and read each one?

@HouzuoGuo
Copy link
Owner

"all" in query processor is optimized so that documents need not to be serialized, therefore it is a very fast operation, but still the entire collection file needs to be scanned.

HTTP query has three endpoints, "count" and "queryID" do not require document serialization, however "query" does.

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

No branches or pull requests

2 participants