How to add an item to a collection in RacerJs DerbyJs? - collections

I want to add an item to a collection using RacerJs/DerbyJs, but it just doesn't work. I must be really overlooking something...
What I tried
model.set('news', [
{ text: "something" }
]);
And that does set a news-item. However, when I do this another time, it will just overwrite the existing item, and not add a new one. How to do that?
model.push('news', {text:"someText"}) also fails with "Object is not an array".
Basically, I just want the most basic version of a "post an update and show on 'wall' app", without any rooms nor making use of Arrays. Just one collection, and that's it.
Stacktrace of the .push() variant:
Wed May 22 2013 09:35:24 GMT+0200 (W. Europe Daylight Time) (23168) d7564d2d-f23
8-4ce0-a0a2-6e376e9b5cb1 ? ver: 0 - push 'news', { text: 'adsf' }
C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\
Memory.js:185
throw new TypeError(arr + ' is not an Array');
^
TypeError: [object Object] is not an Array
at Object.arrayLookupSet [as _arrayLookupSet] (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\Memory.js:185:11)
at Object.applyArrayMethod [as _applyArrayMethod] (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\Memory.js:145:18)
at Object.push (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\Memory.js:118:15)
at applyTxn (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\transaction.js:114:32)
at Object.exports.applyTxnToDoc (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\transaction.js:126:3)
at Function.QueryInterface.publish (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\adapters\pubsub-memory\channel-interface-query.js:25:24)
at PubSub.publish (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\pubSub\PubSub.js:63:10)
at Store.module.exports.proto.publish (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\pubSub\pubSub.Store.js:174:20)
at publish (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\txns\txns.Store.js:230:15)
at next (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\middleware.js:7:26)
at module.exports.events.middleware.txn (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\txns\txns.Store.js:220:11)
at Store._sendToDb.lockingDone (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\Store.js:294:12)
at mergeAll.setupRoutes (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\adapters\db-memory\index.js:70:13)
at DbMemory.mergeAll.get (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\adapters\db-memory\index.js:44:5)
at mergeAll.setupRoutes (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\adapters\db-memory\index.js:62:16)
at DbMemory.mergeAll.get (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\adapters\db-memory\index.js:44:5)
at mergeAll.setupRoutes (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\adapters\db-memory\index.js:60:14)
at next (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\Store.js:321:15)
at Store._sendToDb (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\Store.js:324:10)
at writeToDb (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\txns\txns.Store.js:216:15)
at next (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\middleware.js:7:26)
at serialEmitPrep (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\txns\txns.Store.js:125:9)
at next (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\middleware.js:7:26)
at incrVer (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\modes\lww.js:18:12)
at next (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\middleware.js:7:26)
at Object.module.exports.events.init.store.eachContext.context.guardWrite (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\accessControl\accessControl.Store.js:54:51)
at accessController (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\txns\txns.Store.js:103:17)
at next (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\middleware.js:7:26)
at Object.run (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\middleware.js:10:12)
at Socket.module.exports.events.socket (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\txns\txns.Store.js:267:26)
at Socket.racer.log.sockets.sockets.on.socket.on (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\lib\log.server.js:150:20)
at Socket.EventEmitter.emit [as $emit] (events.js:91:17)
at SocketNamespace.handlePacket (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\namespace.js:335:22)
at Manager.onClientMessage (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\manager.js:488:38)
at WebSocket.Transport.onMessage (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transport.js:387:20)
at Parser. (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:39:10)
at Parser.EventEmitter.emit (events.js:88:17)
at opcodeHandlers.1.finish (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:288:16)
at Parser.opcodeHandlers.1.expectData [as expectHandler] (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:299:15)
at Parser.add (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:466:24)
at Parser.expect (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:499:10)
at Parser.opcodeHandlers.1.expectData (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:298:18)
at Parser.add (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:466:24)
at Parser.expect (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:499:10)
at opcodeHandlers.1.expectData (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:296:16)
at opcodeHandlers.1 (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:313:9)
at Parser.processPacket (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:533:8)
at Parser.add (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:466:24)
at Socket.WebSocket.onSocketConnect (C:\xampp\htdocs\Derbyjs\KnowEdge\app1\node_modules\derby\node_modules\racer\node_modules\socket.io\lib\transports\websocket\hybi-16.js:141:17)
at Socket.EventEmitter.emit (events.js:88:17)
at TCP.onread (net.js:396:14)

If you are trying to add a document to a collection you can also call model.add
model.add('news', {
text: "Something"
})
Which will add a new document to the news collection and generate the id for you.
More documentation can be found under http://derbyjs.com/#getters_and_setters

To create an item in the collection you can call model.set with explicitly specified path containing document ID, for example:
model.set('news.' + model.id(), {
text: "something"
})
model.id method will generate unique ID on each call to it.

Related

Edges collection undefined until _collections() operation is used

I'm using ArangoDB 3.4.2 and I have a weird problem that I'm not able to explain...
I create a graph (myGraph) in the following in arangosh:
var graph_module = require('#arangodb/general-graph');
var myGraph = graph_module._create('mygraph');
myGraph._addVertexCollection('vertexes');
var edges = graph_module._relation('edges', ['vertexes'], ['vertexes']);
myGraph._extendEdgeDefinitions(edges);
Being vertexes and edges the collections for vertexes and edges, respectively.
Now, I create two vertexes:
db.vertexes.save({"name": "A", "_key": "A"});
db.vertexes.save({"name": "B", "_key": "B"});
So far so good. But now I try to create the edge between both and I get a fail:
127.0.0.1:8529#myDB> db.edges.save("vertexes/A", "vertexes/B", {"name": "A-to-B"});
JavaScript exception: TypeError: Cannot read property 'save' of undefined
!db.edges.save("vertexes/A", "vertexes/B", {"name": "A-to-B"});
! ^
stacktrace: TypeError: Cannot read property 'save' of undefined
at <shell command>:1:9
It seems that db.edges is undefined:
127.0.0.1:8529#MyDB> console.log(db.edges)
2019-01-26T19:01:52Z [98311] INFO undefined
But now, if I run db._collections() it seems that db.edges gets defined (weird!)
127.0.0.1:8529#MyDB> db._collections()
...
127.0.0.1:8529#MyDB> console.log(db.edges)
2019-01-26T19:02:58Z [98311] INFO [ArangoCollection 16807, "edges" (type edge, status loaded)]
and in this moment, the db.edges.save(...) operation works:
127.0.0.1:8529#MyDB> db.edges.save("vertexes/A", "vertexes/B", {"name": "A-to-B"});
{
"_id" : "edges/16899",
"_key" : "16899",
"_rev" : "_YGsKKq2--_"
}
Why db.edges is undefined at the first save()? Why a show colletions operation (which I understand is read-only) is getting it defined? Maybe I'm doing something wrong?
When executing db.edges.save() an internal cache is accessed. If this cache is clear, executing db.edges.save() works to save an edge. Since db._collections() resets this cache, it is possible to run the command afterwards. However if this cache is not clear, an error is thrown as you observed.
The correct and safe way is to access the collection via db._collection("collection-name").
Therefore you can use the following command to save an edge in the edges collection:
db._collection("edges").save("vertexes/A", "vertexes/B", {"name": "A-to-B"});

Gulp group media error "must start with number, buffer, array or string"

I use
var cmq = require('gulp-combine-media-queries')
gulp.task('cmq', function () {
gulp.src('css/style.css')
.pipe(cmq({
log: true
}))
.pipe(gulp.dest('dist'));
});
And this error is output after gulp command:
File css/style.css found.
buffer.js:169
throw new TypeError('must start with number, buffer, array or
string');
^
TypeError: must start with number, buffer, array or string
at fromObject (buffer.js:169:9)
at new Buffer (buffer.js:62:10)
at Transform.transform [as _transform] (/home/user/node_modules/gulp-
combine-media-queries/index.js:152:21)
at Transform._read (/home/user/node_modules/gulp-combine-media-
queries/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at Transform._write (/home/user/node_modules/gulp-combine-media-
queries/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/home/user/node_modules/gulp-combine-media-
queries/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/home/user/node_modules/gulp-combine-media-
queries/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at Transform.Writable.write (/home/user/node_modules/gulp-combine-
media-queries/node_modules/readable-
stream/lib/_stream_writable.js:194:11)
at write (/home/user/node_modules/vinyl-fs/node_modules/readable-
stream/lib/_stream_readable.js:623:24)
at flow (/home/user/node_modules/vinyl-fs/node_modules/readable-
stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/home/user/node_modules/vinyl-
fs/node_modules/readable-stream/lib/_stream_readable.js:664:5)
at emitNone (events.js:67:13)
at DestroyableTransform.emit (events.js:166:7)
at emitReadable_ (/home/user/node_modules/vinyl-
fs/node_modules/readable-stream/lib/_stream_readable.js:448:10)
at emitReadable (/home/user/node_modules/vinyl-
fs/node_modules/readable-stream/lib/_stream_readable.js:444:5)
at readableAddChunk (/home/user/node_modules/vinyl-
fs/node_modules/readable-stream/lib/_stream_readable.js:187:9)
Node - 4.2.6, Gulp 3.9.1, npm - 3.5.2
I also used another npms for grouping media and have the same errors. I read many articles with the same problems, but none has helped
looking at media-query code (https://github.com/konitter/gulp-combine-media-queries/blob/master/index.js)
I could see that your file "css/style.css" is not accessible by gulp hence the error.
Please recheck the path and try again

NoSuchElementError: no such element: Unable to locate element for protractor

element(By.xpath(("/html/body/div[2]/div[3]/md-content/md-card/md-card-content/div/div/div/div/md-custom-table/div/md-table-container/table/thead/tr/th[3]/span"))).click();
This is the code I want to make it work.
This isxpath path of where I want to be clicked
/html/body/div[2]/div[3]/md-content/md-card/md-card-content/div/div/div/div/md-custom-table/div/md-table-container/table/thead/tr/th[3]/span
This is the error
Message:
Failed: No element found using locator: By(xpath, /html/body/div[2]/div[3]/md-content/md-card/md-card-content/div/div/div/div/md-custom-table/div/md-table-container/table/thead/tr/th[3]/span) Stack:
NoSuchElementError: No element found using locator:
By(xpath, /html/body/div[2]/div[3]/md-content/md-card/md-card-content/div/div/div/div/md-custom-table/div/md-table-container/table/thead/tr/th[3]/span)
at WebDriverError (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:26:26)
at NoSuchElementError (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:241:26)
at /usr/lib/node_modules/protractor/built/element.js:717:27
at ManagedPromise.invokeCallback_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2775:27
at /usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7)Error
at ElementArrayFinder.applyAction_ (/usr/lib/node_modules/protractor/built/element.js:403:27)
at ElementArrayFinder._this.(anonymous function) [as click] (/usr/lib/node_modules/protractor/built/element.js:101:30)
at ElementFinder.(anonymous function) [as click] (/usr/lib/node_modules/protractor/built/element.js:740:22)
at Object.<anonymous> (/home/vegan/hb-productupload/gateway/src/test/javascript/e2e/account/productDashboard/productDashboardControllerSpec.js:36:47)
at /usr/lib/node_modules/protractor/node_modules/jasminewd2/index.js:94:23
at new ManagedPromise (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1082:7)
at controlFlowExecute (/usr/lib/node_modules/protractor/node_modules/jasminewd2/index.js:80:18)
at TaskQueue.execute_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25
From: Task: Run it("should be able to check product dashboard as a cta") in control flow
at Object.<anonymous> (/usr/lib/node_modules/protractor/node_modules/jasminewd2/index.js:79:14)
at /usr/lib/node_modules/protractor/node_modules/jasminewd2/index.js:16:5
at ManagedPromise.invokeCallback_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2775:27
From asynchronous test:
Error
at Suite.<anonymous> (/home/vegan/hb-productupload/gateway/src/test/javascript/e2e/account/productDashboard/productDashboardControllerSpec.js:33:9)
at Object.<anonymous> (/home/vegan/hb-productupload/gateway/src/test/javascript/e2e/account/productDashboard/productDashboardControllerSpec.js:8:1)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
1 spec, 1 failure Finished in 13.16 seconds
[15:19:25] I/launcher - 0 instance(s) of WebDriver still running
[15:19:25] I/launcher - chrome #01 failed 1 test(s)
[15:19:25] I/launcher - overall: 1 failed spec(s)
[15:19:25] E/launcher - Process exited with error code 1
So for same place, this is html:
<span translate="" class="ng-scope ng-binding">Number of Products</span>
This is the selector
body > div.site-content > div.layout-column.flex > md-content > md-card > md-card-content > div > div > div > div > md-custom-table > div > md-table-container > table > thead > tr > th.md-column.ng-scope.ng-isolate-scope.flex.md-sort.md-active > span
For same span, this can click
dashboardPageObject.element.all(by.css('[md-order-by="count"]')).get(1);.click();
browser.driver.sleep(28);
dashboardPageObject.element.all(by.css('[md-order-by="count"]')).get(1);.click();
It clicks 2 times but it does not wait 28 seconds.
I don't care selector for the xpath or css. For example for another
/html/body/div[2]/div[3]/header/md-content/md-tabs/md-tabs-wrapper/md-tabs-canvas/md-pagination-wrapper/md-tab-item[5]/span
This works
element(by.xpath('/html/body/div[2]/div[3]/header/md-content/md-tabs/md-tabs-wrapper/md-tabs-canvas/md-pagination-wrapper/md-tab-item[5]/span'));
First, as I mentioned above in the comments, the sleep() timer takes milliseconds, not seconds. So you are only waiting 0.28 seconds with that command. Extend it to 28000 if you really want to sleep for 28 seconds.
However, that's not the best approach. You should use implicit waits in the form of Expected Conditions so your tests are efficient and execute in a consistent manner.
You'll have to decide which method works best for you depending on the nature of that element you are trying to click, but you probably will end up using presenceOf() or visibilityOf().
presenceOf() waits for something to be appended to the DOM
visibilityOf() takes an existing element and waits for it to be visible.
Finally, xpath is not a great locator. It may work now in your current test, but xpath is very brittle as it's subject to easily change as development continues. I'd advise you to find another way to locate that element, since there aren't many attributes on that particular element I would probably choose cssContainingText()
So combining the above:
var el = element(by.cssContainingText('span', 'Number of Products'));
var EC = protractor.ExpectedConditions;
browser.wait(EC.presenceOf(el), 5000); // maximum wait of 5 seconds
expect(something).toEqual(your expected result);
This is po file
import { element, by, ElementArrayFinder, ElementFinder } from 'protractor';
export class scopePos {
greet() {
element(by.xpath("//scope-setup-panel/mat-expansion-panel/div/div/div/div[1]/div[2]/div[2]")).click()// click is not working here
}
}
Step definition file
export default function () {
this.When(/^I verified the event scope card$/, function (next) {
//z created an object of po file and calling
z.greet()
next();
});
}

Custom command result

When invoking a custom command, I noticed that only the logs are displayed. For example, if my Custom Comand script contains a retrun statement return "great custom command", I can't find it in the result. Both in API Java client or shell execution cases.
What can I do to be able to retrieve that result at the end of an execution?
Thanks.
Command definition in service description file:
customCommands ([
"getText" : "getText.groovy"
])
getText.groovy file content:
def text = "great custom command"
println "trying to get a text"
return text
Assuming that you service file contains the following :
customCommands ([
"printA" : {
println "111111"
return "222222"
},
"printB" : "fileB.groovy"
])
And fileB.groovy contains the following code :
println "AAAAAA"
return "BBBBBB"
Then if you run the following command : invoke yourService printA
You will get this :
Invocation results:
1: OK from instance #1..., Result: 222222
invocation completed successfully.
and if you run the following command : invoke yourService printB
You will get this :
Invocation results:
1: OK from instance #1..., Result: AAAAAA
invocation completed successfully.
So if your custom command's implementation is a Groovy closure, then its result is its return value.
And if your custom command's implementation is an external Groovy file, then its result is its last statement output.
HTH,
Tamir.

Exception from setTimeout callback: { stack: [Getter] } and Mongo error

I'm getting following exception thrown:
=> Meteor server restarted
I20130820-00:17:58.852(3)? Exception from setTimeout callback: { stack: [Getter] } MongoError: $or requires nonempty array
I20130820-00:17:58.852(3)? at Object.Future.wait (/home/alexei/.meteor/tools/4010e5731d/lib/node_modules/fibers/future.js:326:15)
I20130820-00:17:58.853(3)? at _.extend._nextObject (packages/mongo-livedata/mongo_driver.js:540)
I20130820-00:17:58.853(3)? at _.extend.forEach (packages/mongo-livedata/mongo_driver.js:570)
I20130820-00:17:58.853(3)? at _.extend.map (packages/mongo-livedata/mongo_driver.js:582)
I20130820-00:17:58.853(3)? at _.extend.fetch (packages/mongo-livedata/mongo_driver.js:606)
I20130820-00:17:58.853(3)? at _.each.Cursor.(anonymous function) [as fetch] (packages/mongo-livedata/mongo_driver.js:444)
I20130820-00:17:58.854(3)? at MongoConnection.findOne (packages/mongo-livedata/mongo_driver.js:362)
I20130820-00:17:58.854(3)? at _.extend.findOne (packages/mongo-livedata/collection.js:225)
I20130820-00:17:58.854(3)? at _.extend.findOne (packages/collectionFS/collectionFS_common.js:4)
I20130820-00:17:58.855(3)? at _.extend.checkQueue (packages/collectionFS/collectionFS_filehandlers.js:95)
I20130820-00:17:58.855(3)? - - - - -
I20130820-00:17:58.855(3)? at Object.toError (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/utils.js:110:11)
I20130820-00:17:58.855(3)? at Cursor.nextObject.self.queryRun (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:634:54)
I20130820-00:17:58.856(3)? at Cursor.close (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:903:5)
I20130820-00:17:58.856(3)? at Cursor.nextObject.commandHandler (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:634:21)
I20130820-00:17:58.856(3)? at Db._executeQueryCommand (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/db.js:1658:9)
I20130820-00:17:58.856(3)? at Server.Base._callHandler (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/base.js:378:41)
I20130820-00:17:58.856(3)? at Server.connect.connectionPool.on.server._serverState (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/server.js:468:18)
I20130820-00:17:58.857(3)? at MongoReply.parseBody (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
I20130820-00:17:58.857(3)? at Server.connect.connectionPool.on.server._serverState (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/server.js:426:20)
I20130820-00:17:58.857(3)? at EventEmitter.emit (events.js:96:17)
Please advise, what is causing the problem?
I'm on 0.6.5 meteor, 0.6.6 mrt, 0.10.13 node and 1.3.2 npm.
BTW, application itself works fine :)
Please advise.
Thank you,
Alexei
The query inside your Meteor.setTimeout block of code has an $or keyword which contains an empty array. You need to have at least two items in there for your operation.
If you're having trouble/using some kind of way to build an $or query you could update your code with this block of code so we could be of further help

Resources