@@ -5,6 +5,7 @@ module Mongo
5
5
, CollectionName
6
6
, Query
7
7
, AggregationQuery
8
+ , Entry
8
9
, client
9
10
, database
10
11
, collections
@@ -23,38 +24,30 @@ type CollectionName = String
23
24
24
25
foreign import data Client :: Type
25
26
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
29
31
30
32
foreign import client :: String -> Promise Client
31
33
foreign import database :: Client -> String -> Database
32
34
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 )
44
39
45
40
foreign import findOne
46
- :: forall a
47
- . Database
41
+ :: Database
48
42
-> CollectionName
49
- -> Query a
50
- -> Promise (Array a )
43
+ -> Query
44
+ -> Promise (Array Entry )
51
45
52
- find' :: forall a . Database -> Query a -> CollectionName -> Cursor a
46
+ find' :: Database -> Query -> CollectionName -> Cursor
53
47
find' db query collection = find db collection query
54
48
55
49
foreign import aggregate
56
- :: forall a
57
- . Database
50
+ :: Database
58
51
-> CollectionName
59
- -> AggregationQuery a
60
- -> Cursor a
52
+ -> AggregationQuery
53
+ -> Cursor
0 commit comments