Skip to content

Commit 9692ffd

Browse files
committed
Reproduce exceptions for in ids + dynamic limit + dynamic offset
1 parent b897537 commit 9692ffd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/mongo_ecto_test.exs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ defmodule Mongo.EctoTest do
9191
assert 10 == TestRepo.one(query)
9292
end
9393

94+
test "where in ids + dynamic limit + dynamic offset" do
95+
post1 = TestRepo.insert!(%Post{})
96+
post2 = TestRepo.insert!(%Post{})
97+
ids = [post1.id, post2.id]
98+
limit = 1
99+
offset = 1
100+
101+
query = from p in Post, where: p.id in ^ids, limit: ^limit, offset: ^offset
102+
assert TestRepo.all(query) == [post2]
103+
end
104+
94105
# test "partial update in map" do
95106
# post = TestRepo.insert!(%Post{meta: %{author: %{name: "michal"}, other: "value"}})
96107
# TestRepo.update_all(Post, set: [meta: change_map("author.name", "michal")])

0 commit comments

Comments
 (0)