You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,7 @@
2
2
# DocDB
3
3
4
4
LOG-based JavaScript DataBase (based on streaming processing).
5
-
The database is currently under development, please do not use it in production. The API will be significantly changed.
6
-
7
-
## Note
8
-
The main problem at the moment is that the recording stream should always be open (to ensure insertion performance), but in fact I can not get the document insertion event in the data file due to the complexity of the streaming architecture.
9
-
Those. the insert operation occurs without real feedback from the recording stream.
@@ -199,6 +203,9 @@ let DataStore = function(config){
199
203
selfstream.push(buffer);//передаю сжатую строку дальше
200
204
self.streams.transform['_id.key'].write({_id: _id,start: self.firstByte,end: self.firstByte+_byteLength});//записываю в первичный ключ байты начала и конца объекта
201
205
self.firstByte=self.firstByte+_byteLength;//меняю первый байт для следующей записи
206
+
if(typeof(_id_)==='string'){
207
+
self.ee.emit(_id_);
208
+
}
202
209
returncallback();
203
210
});
204
211
}else{
@@ -654,16 +661,21 @@ let DataStore = function(config){
654
661
}
655
662
656
663
//запись объекта в СУБД
657
-
self.methods.insertOne=function(object){
664
+
self.methods.insertOne=function(_object){
665
+
letobject=Object.assign(_object);
658
666
returnnewPromise(function(rs,rj){
667
+
if(typeof(object._id_)!=='undefined'){
668
+
rj(newError('Object key _id_ reserved for official purposes!'));
@@ -775,8 +787,9 @@ let DataStore = function(config){
775
787
}else{
776
788
self.methods.findOne({_id:index._id},undefined,{start:index.start,end:index.end},true).then(function(doc){//ищу документ в бэкапе файла данных СУБД по соответствующим байтовым координатам
0 commit comments