Skip to content

Commit ab2ef83

Browse files
authored
Merge pull request #1 from eCollect/deps/bump-latest
Release 1.12.0
2 parents 575071f + 561894a commit ab2ef83

18 files changed

+515
-3288
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
sudo: true
22

33
before_install:
4-
- wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz -O /tmp/dynamodb_local_latest.tar.gz
54
- tar -xzf /tmp/dynamodb_local_latest.tar.gz -C /tmp
65
- java -Djava.library.path=/tmp/DynamoDBLocal_lib -jar /tmp/DynamoDBLocal.jar -inMemory &
76
- sleep 2

README.md

+1-91
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,8 @@
1-
# ⚠️ IMPORTANT NEWS! 📰
2-
3-
I’ve been dealing with CQRS, event-sourcing and DDD long enough now that I don’t need working with it anymore unfortunately, so at least for now this my formal farewell!
4-
5-
I want to thank everyone who has contributed in one way or another.
6-
Especially...
7-
8-
- [Jan](https://github.com/jamuhl), who introduced me to this topic.
9-
- [Dimitar](https://github.com/nanov), one of the last bigger contributors and maintainer.
10-
- My last employer, who gave me the possibility to use all these CQRS modules in a big Cloud-System.
11-
- My family and friends, who very often came up short.
12-
13-
Finally, I would like to thank [Golo Roden](https://github.com/goloroden), who was there very early at the beginning of my CQRS/ES/DDD journey and is now here again to take over these modules.
14-
15-
Golo Roden is the founder, CTO and managing director of [the native web](https://www.thenativeweb.io/), a company specializing in native web technologies. Among other things, he also teaches CQRS/ES/DDD etc. and based on his vast knowledge, he brought wolkenkit to life.
16-
[wolkenkit](https://wolkenkit.io) is a CQRS and event-sourcing framework based on Node.js. It empowers you to build and run scalable distributed web and cloud services that process and store streams of domain events.
17-
18-
With this step, I can focus more on [i18next](https://www.i18next.com), [locize](https://locize.com) and [localistars](https://localistars.com). I'm happy about that. 😊
19-
20-
So, there is no end, but the start of a new phase for my CQRS modules. 😉
21-
22-
I wish you all good luck on your journey.
23-
24-
Who knows, maybe we'll meet again in a github issue or PR at [i18next](https://github.com/i18next/i18next) 😉
25-
26-
27-
[Adriano Raiano](https://twitter.com/adrirai)
28-
29-
---
30-
311
# Introduction
322

333
[![travis](https://img.shields.io/travis/adrai/node-viewmodel.svg)](https://travis-ci.org/adrai/node-viewmodel) [![npm](https://img.shields.io/npm/v/viewmodel.svg)](https://npmjs.org/package/viewmodel)
344

5+
This is a fork of `thenativeweb/node-viewmodel` since the latter was deprecated.
356
Node-viewmodel is a node.js module for multiple databases.
367
It can be very useful if you work with (d)ddd, cqrs, eventdenormalizer, host, etc.
378

@@ -248,7 +219,6 @@ Make shure you have installed the required driver, in this example run: 'npm ins
248219
currently supported by:
249220
- inmemory
250221
- mongodb
251-
- elasticsearch6
252222

253223

254224
## mongodb
@@ -281,61 +251,6 @@ For mongodb you can define indexes for performance boosts in find function.
281251
## redis
282252
The find function does ignore the query argument and always fetches all items in the collection.
283253

284-
## Elasticsearch >= 5.X
285-
Use the 'elasticsearch6' type for Elasticsearch versions 5.X and 6.X.
286-
287-
The find queries are not mongoDb compatible as the rest of the implementations due to the uneeded overhead and complexity of converting between both formats.
288-
289-
For find queries with elasticsearch6 use elasticsearch [native elastic Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html);
290-
291-
repository.find( onlyTheQueryClause, otherBodyOptions, callback);
292-
293-
```javascript
294-
repository.find(
295-
{
296-
range : {
297-
age : {
298-
gte : 10,
299-
lte : 20
300-
}
301-
}
302-
),
303-
{
304-
from: 0,
305-
size: 10,
306-
sort: { age: 'asc' }
307-
},
308-
function(error, results) {
309-
});
310-
```
311-
312-
Additionaly for elasticsearch6 the number of shards, number of replicas, the refresh behaivour on index and the mappings on index create can be addtionaly defined to optimize performace.
313-
314-
```javascript
315-
var dummyRepo = repository.extend({
316-
collectionName: 'dummy',
317-
repositorySettings: {
318-
elasticsearch6: {
319-
refresh: 'wait_for', // optional, refresh behaviour on index, default is true ( ie. force index refresh ) https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-refresh.html
320-
waitForActiveShards: 2 // optional, defaults to 1 ( ie. wait only for primary ) https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#create-index-wait-for-active-shards
321-
index: { // optional applied on index create, https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-create-index.html
322-
settings : { // will be merged with the default ones,
323-
number_of_shards: 3, // optional defaults to 1,
324-
number_of_replicas: 1 // optional defaults to 0,
325-
},
326-
mappings : { // optiona will be merged with the default ones,
327-
properties: { // specific properties to not be handled by dynamic mapper
328-
title: {
329-
type: "text"
330-
}
331-
}
332-
}
333-
}
334-
}
335-
}
336-
});
337-
```
338-
339254

340255
# [Release notes](https://github.com/adrai/node-viewmodel/blob/master/releasenotes.md)
341256

@@ -347,11 +262,6 @@ Currently these databases are supported:
347262
3. couchdb ([cradle] (https://github.com/cloudhead/cradle))
348263
4. tingodb ([tingodb] (https://github.com/sergeyksv/tingodb))
349264
5. redis ([redis] (https://github.com/mranney/node_redis))
350-
6. azuretable ([azure-storage](https://github.com/Azure/azure-storage-node))
351-
7. documentdb ([documentdb](https://github.com/Azure/azure-documentdb-node), [doqmentdb](https://github.com/a8m/doqmentdb))
352-
8. elasticsearch ([elasticsearch] (https://github.com/elastic/elasticsearch-js))
353-
9. elasticsearch6 ([elasticsearch] (https://github.com/elastic/elasticsearch-js)) - for Elasticsearch 5.x and 6.x
354-
10. dynamodb ([aws-sdk] (https://github.com/aws/aws-sdk-js))
355265

356266
## own db implementation
357267
You can use your own db implementation by extending this...

lib/base.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ var util = require('util'),
22
EventEmitter = require('events').EventEmitter,
33
_ = require('lodash'),
44
prequire = require('parent-require'),
5-
uuid = require('uuid').v4,
65
ViewModel = require('./viewmodel');
76

7+
const { v4: uuid } = require('uuid');
8+
89
/**
910
* Repository constructor
1011
* @param {Object} options The options can have information like host, port, etc. [optional]

lib/databases/azuretable.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ var util = require('util'),
44
ConcurrencyError = require('../concurrencyError'),
55
azure = Repository.use('azure-storage'),
66
async = require('async'),
7-
uuid = require('uuid').v4,
87
_ = require('lodash'),
98
jsondate = require('jsondate'),
109
eg = azure.TableUtilities.entityGenerator,
1110
collections = [];
1211

12+
const { v4: uuid } = require('uuid');
13+
1314
//helpers
1415
function generateEntity(obj) {
1516
var entity = _.clone(obj);

0 commit comments

Comments
 (0)