Compare commits

..

No commits in common. "5c7d74c7617594ea5f527dba8267b64afd9eadef" and "0d4bf3c17fd9f00e6dedcb7fa486e850624de978" have entirely different histories.

1 changed files with 4 additions and 10 deletions

View File

@ -13,9 +13,6 @@ class ListRecordStream extends stream.Transform {
} }
_transform(itemObj, encoding, callback) { _transform(itemObj, encoding, callback) {
if (itemObj && itemObj.o && itemObj.o._id) {
console.log('ITEM OBJ', itemObj.o._id);
}
// always update to most recent uniqID // always update to most recent uniqID
this._lastUniqID = itemObj.h.toString(); this._lastUniqID = itemObj.h.toString();
@ -30,22 +27,21 @@ class ListRecordStream extends stream.Transform {
if (!this._lastEndID || this._lastEndID === itemObj.h.toString()) { if (!this._lastEndID || this._lastEndID === itemObj.h.toString()) {
this._unpublishedListing = true; this._unpublishedListing = true;
} }
console.log('SKIPPING EARLY');
return callback(); return callback();
} }
const dbName = itemObj.ns.split('.'); const dbName = itemObj.ns.split('.');
let entry; let entry;
if (itemObj.op === 'i' && itemObj.o && itemObj.o._id) { if (itemObj.op === 'i' &&
console.log('PROCESSING I'); itemObj.o && itemObj.o._id) {
entry = { entry = {
type: 'put', type: 'put',
key: itemObj.o._id, key: itemObj.o._id,
// value is given as-is for inserts // value is given as-is for inserts
value: JSON.stringify(itemObj.o.value), value: JSON.stringify(itemObj.o.value),
}; };
} else if (itemObj.op === 'u' && itemObj.o && itemObj.o2 && itemObj.o2._id) { } else if (itemObj.op === 'u' &&
console.log('PROCESSING U'); itemObj.o && itemObj.o2 && itemObj.o2._id) {
entry = { entry = {
type: 'put', // updates overwrite the whole metadata, type: 'put', // updates overwrite the whole metadata,
// so they are considered as puts // so they are considered as puts
@ -58,14 +54,12 @@ class ListRecordStream extends stream.Transform {
}; };
} else if (itemObj.op === 'd' && } else if (itemObj.op === 'd' &&
itemObj.o && itemObj.o._id) { itemObj.o && itemObj.o._id) {
console.log('PROCESSING D');
entry = { entry = {
type: 'delete', type: 'delete',
key: itemObj.o._id, key: itemObj.o._id,
// deletion yields no value // deletion yields no value
}; };
} else { } else {
console.log('SKIPPED ENTRY');
// skip other entry types as we don't need them for now // skip other entry types as we don't need them for now
// ('c', ...?) // ('c', ...?)
return callback(); return callback();