Skip to content

Commit c1b89f4

Browse files
committed
Add a support for HTTP NoSQL embedded databases.
1 parent f01f9b2 commit c1b89f4

4 files changed

Lines changed: 213 additions & 131 deletions

File tree

changes.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
- added: `MailMessage.send2([callback])` sends a message according to the framework configuration
77
- added: a new filter for NoSQL embedded `DatabaseBuilder.contains(name)`
88
- added: a new filter for NoSQL embedded `DatabaseBuilder.empty(name)`
9-
- added: NoSQL counter supports daily stats (NoSQL counter files will be upgraded automatically and backwards incompatible)
9+
- added: (IMPORTANT) NoSQL counter supports daily stats (NoSQL counter files will be upgraded automatically and backwards incompatible)
10+
- added: (IMPORTANT) NoSQL database and counter can read data from URL
1011
- added: NoSQL counter `db.counter.clear()` for clearing stats
1112
- added: NoSQL counter `db.counter.daily_sum()` for reading stats
1213
- added: NoSQL counter `db.counter.daily_max()` for reading stats
@@ -25,6 +26,7 @@
2526
- added: NoSQL counter `db.counter.min(id, value)` for writing stats
2627
- added: NoSQL counter `db.counter.max(id, value)` for writing stats
2728
- added: NoSQL counter `db.counter.sum(id, value)` for writing stats (alias for `db.counter.hit()`)
29+
- added: NoSQL counter: a new event `stats` when the stats are changed
2830

2931
- updated: (IMPORTANT) packages compress/decompress function supports streaming data
3032
- updated: (IMPORTANT) `NOSQL().backup()` !!! was changed !!!!

index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,15 @@ F.nosql = function(name) {
11301130
var db = F.databases[name];
11311131
if (db)
11321132
return db;
1133-
F.path.verify('databases');
1134-
db = framework_nosql.load(name, F.path.databases(name));
1133+
1134+
var is = name.substring(0, 6);
1135+
if (is === 'http:/' || is === 'https:')
1136+
db = framework_nosql.load(U.getName(name), name);
1137+
else {
1138+
F.path.verify('databases');
1139+
db = framework_nosql.load(name, F.path.databases(name));
1140+
}
1141+
11351142
F.databases[name] = db;
11361143
return db;
11371144
};

0 commit comments

Comments
 (0)