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

[WIP] Change Stream #205

Closed
wants to merge 7 commits into from
Closed

[WIP] Change Stream #205

wants to merge 7 commits into from

Conversation

ankhers
Copy link
Collaborator

@ankhers ankhers commented May 22, 2018

Resolves #204

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)

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)

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)

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)

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])

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])

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()

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

@ankhers ankhers mentioned this pull request May 22, 2018
@sourcelevel-bot
Copy link

Ebert has finished reviewing this Pull Request and has found:

  • 3 possible new issues (including those that may have been commented here).
  • 5 fixed issues! 🎉

But beware that this branch is 2 commits behind the ankhers:master branch, and a review of an up to date branch would produce more accurate results.

You can see more details about this review at https://ebertapp.io/github/ankhers/mongodb/pulls/205.

@ankhers
Copy link
Collaborator Author

ankhers commented May 10, 2019

closing and starting fresh.

@ankhers ankhers closed this May 10, 2019
@ankhers ankhers deleted the change_stream branch May 14, 2019 18:31
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

Successfully merging this pull request may close these issues.

Change Stream support
1 participant