Skip to content

Commit e060834

Browse files
committed
Revert "Parametrize mongo queries"
This reverts commit 2fbf10c.
1 parent 2fbf10c commit e060834

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

src/Mongo/Mongo.purs

+16-23
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module Mongo
55
, CollectionName
66
, Query
77
, AggregationQuery
8+
, Entry
89
, client
910
, database
1011
, collections
@@ -23,38 +24,30 @@ type CollectionName = String
2324

2425
foreign import data Client :: Type
2526
foreign import data Database :: Type
26-
foreign import data Cursor :: Type -> Type
27-
foreign import data Query :: Type -> Type
28-
foreign import data AggregationQuery :: Type -> Type
27+
foreign import data Cursor :: Type
28+
foreign import data Query :: Type
29+
foreign import data AggregationQuery :: Type
30+
foreign import data Entry :: Type
2931

3032
foreign import client :: String -> Promise Client
3133
foreign import database :: Client -> String -> Database
3234
foreign import collections :: Database -> Promise (Array String)
33-
34-
foreign import find
35-
:: forall a
36-
. Database
37-
-> CollectionName
38-
-> Query a
39-
-> Cursor a
40-
41-
foreign import skip :: forall a. Int -> Cursor a -> Cursor a
42-
foreign import limit :: forall a. Int -> Cursor a -> Cursor a
43-
foreign import toArray :: forall a. Cursor a -> Promise (Array a)
35+
foreign import find :: Database -> CollectionName -> Query -> Cursor
36+
foreign import skip :: Int -> Cursor -> Cursor
37+
foreign import limit :: Int -> Cursor -> Cursor
38+
foreign import toArray :: Cursor -> Promise (Array Entry)
4439

4540
foreign import findOne
46-
:: forall a
47-
. Database
41+
:: Database
4842
-> CollectionName
49-
-> Query a
50-
-> Promise (Array a)
43+
-> Query
44+
-> Promise (Array Entry)
5145

52-
find' :: forall a. Database -> Query a -> CollectionName -> Cursor a
46+
find' :: Database -> Query -> CollectionName -> Cursor
5347
find' db query collection = find db collection query
5448

5549
foreign import aggregate
56-
:: forall a
57-
. Database
50+
:: Database
5851
-> CollectionName
59-
-> AggregationQuery a
60-
-> Cursor a
52+
-> AggregationQuery
53+
-> Cursor

0 commit comments

Comments
 (0)