Skip to content

Commit

Permalink
Reproduce exceptions for in ids + dynamic limit + dynamic offset
Browse files Browse the repository at this point in the history
  • Loading branch information
exAspArk committed Jan 17, 2019
1 parent b897537 commit 9692ffd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/mongo_ecto_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ defmodule Mongo.EctoTest do
assert 10 == TestRepo.one(query)
end

test "where in ids + dynamic limit + dynamic offset" do
post1 = TestRepo.insert!(%Post{})
post2 = TestRepo.insert!(%Post{})
ids = [post1.id, post2.id]
limit = 1
offset = 1

query = from p in Post, where: p.id in ^ids, limit: ^limit, offset: ^offset
assert TestRepo.all(query) == [post2]
end

# test "partial update in map" do
# post = TestRepo.insert!(%Post{meta: %{author: %{name: "michal"}, other: "value"}})
# TestRepo.update_all(Post, set: [meta: change_map("author.name", "michal")])
Expand Down

0 comments on commit 9692ffd

Please sign in to comment.