Commit graph

454 commits

Author SHA1 Message Date
Jacob Emcken
69bb24b3d9 Prevent "random-uuid already refers to" warning
In Clojure 1.11 the function random-uuid was introduced in clojure.core
causing:

> WARNING: random-uuid already refers to: #'clojure.core/random-uuid in namespace: monger.util, being replaced by: #'monger.util/random-uuid
2022-09-03 08:23:13 +02:00
Punit Naik
d8ce4ae787
docfix 2022-06-23 18:43:43 +05:30
Oscar Korz
ab878ab69c Add uuid-representation option 2022-04-02 15:44:44 -07:00
Zachary
0494128e15
Fix typo: weather to whether 2020-12-05 08:40:30 +08:00
Michael Klishin
9f3d192dff
Merge pull request #196 from mjrb/master
update operators for MongoDB 4.2
2020-08-10 00:46:26 +03:00
Aleksander Eskilson
010a977aac adding mongo options 2020-08-09 16:01:20 -05:00
mjrb
b6bd6e55e2 update operators for MongoDB 4.2 2020-02-27 11:12:50 -05:00
Jiacai Liu
ba29a45cc6
support set max-time on cursor 2019-02-28 16:48:06 +08:00
Michael Klishin
900592e302
Cosmetics, wording 2018-12-07 19:51:59 +03:00
Chris Broome
9d34fc0231
Throw IllegalArgumentException when database name not in uri 2018-12-04 21:20:25 -05:00
Chris Broome
aa08f4b58c
Add more descriptive error message when uri has no db name 2018-12-03 22:12:45 -05:00
Michael Klishin
318e440d0d
(c) year 2018-12-02 21:45:26 +03:00
Michael Klishin
386f06da8c
Update dependencies, adapt to new core.cache and Ragtime APIs 2018-12-02 21:24:29 +03:00
Michael Klishin
ad2ee531a3
$pushAll is gone, replaced by $push + $each
See https://docs.mongodb.com/v3.2/reference/operator/update/each/#up._S_each.
2018-12-02 21:23:20 +03:00
Sean Corfield
f6e5ff75ce
Add $position
Modifier for $push
2018-08-31 17:48:25 -07:00
Vladyslav Aleksakhin
7466db5c4d Add :keywordize option for aggregate that control if resulting map keys will be turned into keywords, default is true. 2018-05-02 11:07:31 +02:00
Michael Klishin
002b91d5e6
Merge pull request #164 from amitvshah25/patch-1
Update operators.clj
2018-02-15 03:28:17 +03:00
amitvshah25
1a256a6033
Update operators.clj
Added count and dateToString operators.
2017-12-14 12:58:44 -05:00
冯忠孝
5d31f9fc1a support java Bigdecimal in mongodb 3.4 or later 2017-11-18 11:31:45 +08:00
Andrew Haines
1ca1469126 Exclude clojure.core/any? to prevent warnings on Clojure 1.9 2017-02-10 15:21:02 +00:00
eunmin
99a113e220 Add affected-count function for WriteResult 2017-01-11 13:45:49 +09:00
Michael Klishin
c1acd78060 Merge pull request #150 from frooeyzanny/fix-pullAll-example
Fix $pullAll example
2016-11-20 19:44:11 +03:00
Michael Klishin
62dc2a9cd3 Merge pull request #149 from frooeyzanny/fix-subtract-operator
substract -> subtract
2016-11-20 19:43:54 +03:00
Michael Klishin
5b5425c402 Merge pull request #144 from caligin/master
fix: missing overload in :arglists, was causing eastwood to complain about correct calls
2016-11-20 19:43:27 +03:00
Juha Jokimaki
1170f342dd Delegate stream creation to GridFS 2016-11-20 18:03:11 +02:00
Evgeny Samsonov
27ed7bdfb7 Fix pullAll example 2016-11-02 18:14:31 +03:00
Evgeny Samsonov
517bb98129 substract -> subtract 2016-11-02 18:00:05 +03:00
Juha Jokimaki
b1cfb5490a Set GridFSInputFile closeStreamOnPersist flag 2016-10-31 08:52:14 +02:00
Juha Jokimaki
0d7dc9357a Add $isolated operator 2016-10-30 18:15:51 +02:00
Juha Jokimaki
82c76dd66d Add $eq operator 2016-10-30 18:06:49 +02:00
Juha Jokimaki
2021c6d07f Fix $ne operator usage
The flaw was exposed when the test name was fixed.
2016-10-30 17:49:32 +02:00
Juha Jokimaki
8fd4946959 Add $where operator 2016-10-30 17:21:15 +02:00
Juha Jokimaki
08ce1e41b3 Add missing geospatial operators 2016-10-30 16:54:46 +02:00
Fulvio Meden
57464ac592
fix: missing overload in :arglists, was causing eastwood to complain about correct calls 2016-10-04 14:24:19 +01:00
eunmin
df09c4085d Add operator 2016-08-19 14:19:50 +09:00
eunmin
ccffffc912 Add missing MongoClientOptions 2016-07-07 21:17:59 +09:00
Samsonov Ivan
2b4c0f8168 Fix keywordize param for find-map-by-id 2016-04-26 19:03:44 +03:00
Divyansh Prakash
5916642b2b Fix reflection warnings. 2016-04-07 16:52:02 +05:30
Torsten Uhlmann
9d51f32fa1 Fixing call to find-map-by-id, threw a ClassCastException
Fixes #131
2016-03-27 13:07:38 +02:00
Michael Klishin
c7a87ac776 Merge branch 'typehint' of https://github.com/boechat107/monger into boechat107-typehint 2016-01-16 14:25:50 +03:00
Andre Ambrosio Boechat
bdecd98b40 with-collection macro: type hints improvement
From all the resources I found about type hinting in macros,
it doesn't work like it does for normal functions.

I got reflection warnings for a code like this:

```clj
(let [conn (mg/connect)
      db (delay (mg/get-db conn "monger-test"))]
  (with-collection @db "something"
    (find {})))
```

The type hint for `db` didn't work. Actually the type hint that works
comes from the function `core/get-db` and we see this when we remove
`delay` from the code above. As we could expect, the function `deref`
doesn't propagate the type hint.

I did similar tests with the collection name and no reflection warning
was raised for any case. In addition, it looked weird for me to have
a type hint like `^String` and then a checking like `string?` later.

Some references:

* http://stackoverflow.com/questions/11919602/generating-clojure-code-with-type-hints
* Clojure High Performance Programming, page 44.
2016-01-15 15:47:47 +01:00
Stijn Opheide
b0df70f279 Fix cursor hinting
The .hint method should be applied on the cursor object instead
of the DBObject contained in the hint field.
2016-01-06 12:00:08 +01:00
Juho Teperi
1299e5e5ff Remove from-db-object implementation for Map
It should be enough that from-db-object is implemented for DBObject
2015-10-09 00:49:28 +03:00
Juho Teperi
c26ae0835d Optimize from-db-object performance for DBObjects
Creating temporary sequence from DBObject is quite slow. Using
.keySet for reduce collection and calling .get inside reduce is
considerably faster. The common code between Map and DBObject
implementations can't be shared as reflection would completely kill the
performance and function can't be type hinted as DBObject doesn't
implement Map interface.

Added a simple test case for the from-db-object performance. I'm seeing
performance increase of 20% on this (170ms -> 140ms).
2015-10-08 22:59:47 +03:00
Artem Chistyakov
8316e7798e Don’t forget to pass credentials to MongoClient
It looks like provided credentials are ignored unless `server-address` is a collection.
2015-09-18 16:07:01 -04:00
Andrei Biasprozvanny
ebc01b3f54 Find-maps now supports keywordize option 2015-08-25 16:48:17 +01:00
Erik Bakstad
d9b103c350 Removed call to removed MongoClientOptions.Builder methods 2015-07-22 21:38:41 +02:00
Michael Klishin
51baa3e154 Adhere to the existing code style 2015-06-27 23:16:11 +03:00
Michael Klishin
4ff7d05aa4 monger.credentials/for => monger.credentials/create
To make sure we don't shadow clojure.core/for when monger.credentials
is required with :refer :all.
2015-06-27 22:39:01 +03:00
Bartek Marcinowski
15f50408a9 Merge branch 'add_options_to_aggregate'
Merge implementation of aggregation framework options and explanation of
aggregation query plan.

Conflicts:
	src/clojure/monger/collection.clj
2015-06-24 16:05:47 +01:00