Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/razum2um/joplin.mongodb
MongoDB support for Joplin
https://github.com/razum2um/joplin.mongodb
clojure migrations mongodb
Last synced: about 1 month ago
JSON representation
MongoDB support for Joplin
- Host: GitHub
- URL: https://github.com/razum2um/joplin.mongodb
- Owner: razum2um
- License: epl-1.0
- Created: 2017-06-09T04:54:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-12T11:02:31.000Z (over 4 years ago)
- Last Synced: 2024-10-06T04:24:24.525Z (about 1 month ago)
- Topics: clojure, migrations, mongodb
- Language: Clojure
- Size: 11.7 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# joplin.mongodb
```
[joplin.mongodb "0.1.2"]
```## Usage
Write [joplin](https://github.com/juxt/joplin) config with `:type :mongodb :uri "..." :collection "..."`
```
{:databases
{:mongodb
{:type :mongodb
:uri "mongodb://userb71148a:[email protected]:27034/app81766662"
:collections "collection to store migration ids, `migrations` by default"}}}```
Generate migrations
```
(joplin.repl/create config :mongodb "migartion-name")
```Use [monger](https://github.com/michaelklishin/monger) and `as-db->` inside your migrations:
```
(ns migrations.mongodb.20170609050347-example
(:require [joplin.mongodb.database :refer :all]
[monger.collection :as mc]))(defn up [db]
(as-db-> db mongodb (mc/update mongodb "notifications" {} {:$rename {:environment :env}} {:multi true})))(defn down [db]
(as-db-> db mongodb (mc/update mongodb "notifications" {} {:$rename {:env :environment}} {:multi true})))
```## License
Copyright © 2017 Vlad Bokov
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.