-
Notifications
You must be signed in to change notification settings - Fork 156
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
[WIP] Change Stream #205
[WIP] Change Stream #205
Conversation
assert [] = Mongo.aggregate(c.pid, coll, []) |> Enum.take(0) | ||
assert [] = Mongo.aggregate(c.pid, coll, []) |> Enum.drop(4) | ||
assert [%{"foo" => 42}] = Mongo.aggregate(c.pid, coll, []) |> Enum.take(1) | ||
assert [%{"foo" => 45}] = Mongo.aggregate(c.pid, coll, []) |> Enum.drop(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a function call when a pipeline is only one function long
assert [%{"foo" => 45}] = Mongo.aggregate(c.pid, coll, [], use_cursor: false) |> Enum.drop(3) | ||
assert [] = Mongo.aggregate(c.pid, coll, []) |> Enum.take(0) | ||
assert [] = Mongo.aggregate(c.pid, coll, []) |> Enum.drop(4) | ||
assert [%{"foo" => 42}] = Mongo.aggregate(c.pid, coll, []) |> Enum.take(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a function call when a pipeline is only one function long
assert [%{"foo" => 42}] = Mongo.aggregate(c.pid, coll, [], use_cursor: false) |> Enum.take(1) | ||
assert [%{"foo" => 45}] = Mongo.aggregate(c.pid, coll, [], use_cursor: false) |> Enum.drop(3) | ||
assert [] = Mongo.aggregate(c.pid, coll, []) |> Enum.take(0) | ||
assert [] = Mongo.aggregate(c.pid, coll, []) |> Enum.drop(4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a function call when a pipeline is only one function long
assert [] = Mongo.aggregate(c.pid, coll, [], use_cursor: false) |> Enum.drop(4) | ||
assert [%{"foo" => 42}] = Mongo.aggregate(c.pid, coll, [], use_cursor: false) |> Enum.take(1) | ||
assert [%{"foo" => 45}] = Mongo.aggregate(c.pid, coll, [], use_cursor: false) |> Enum.drop(3) | ||
assert [] = Mongo.aggregate(c.pid, coll, []) |> Enum.take(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a function call when a pipeline is only one function long
end | ||
|
||
defp handle_execute(:command, nil, [query], opts, s) do | ||
flags = Keyword.take(opts, @find_one_flags) | ||
op_query(coll: Utils.namespace("$cmd", s, opts[:database]), query: query, select: "", | ||
num_skip: 0, num_return: 1, flags: flags(flags)) | ||
|> message_reply(s) | ||
|> message_reply(s, opts[:timeout]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a function call when a pipeline is only one function long
op_get_more(coll: Utils.namespace(coll, s, opts[:database]), cursor_id: cursor_id, | ||
num_return: num_return) | ||
|> message_reply(s) | ||
|> message_reply(s, opts[:timeout]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a function call when a pipeline is only one function long
{"batchSize", opts[:batch_size]}, | ||
{"maxTimeMS", opts[:max_time]} | ||
] | ||
|> filter_nils() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a function call when a pipeline is only one function long
Ebert has finished reviewing this Pull Request and has found:
But beware that this branch is 2 commits behind the You can see more details about this review at https://ebertapp.io/github/ankhers/mongodb/pulls/205. |
closing and starting fresh. |
Resolves #204