These are chat archives for Automattic/mongoose

11th
Jul 2016
awei.yu
@aweiu
Jul 11 2016 09:16
   var newdoc = parent.children.create({ name: 'Aaron' })
why the children is undefined?how to get it?
i want use 'create' to add an doc to the children
any one can help me ?
smahi
@smahi
Jul 11 2016 10:37
Hi, how to find out how many items Model.aggregate result will be ?
Steven Natera
@nodox
Jul 11 2016 16:00
Is there anybody here that can help me debug my mongoose output?
Readable {
pool: null,
server: null,
disconnectHandler:
{ s: { storedOps: [], storeOptions: [Object], topology: [Object] },
length: [Getter] },
bson: {},
ns: 'kard_development.kard_bonus',
cmd:
{ find: 'kard_development.kard_bonus',
limit: 0,
skip: 0,
query: { bank: 'Chase' },
slaveOk: false },
options:
{ skip: 0,
limit: 0,
raw: undefined,
hint: null,
timeout: undefined,
slaveOk: false,
db:
EventEmitter {
domain: null,
_events: [Object],
_eventsCount: 6,
_maxListeners: undefined,
s: [Object],
serverConfig: [Getter],
bufferMaxEntries: [Getter],
databaseName: [Getter],
_listening: true },
promiseLibrary: [Function: Promise],
disconnectHandler: { s: [Object], length: [Getter] } },
topology:
EventEmitter {
domain: null,
_events:
{ reconnect: [Function],
timeout: [Object],
error: [Object],
close: [Function],
destroy: [Object],
serverDescriptionChanged: [Function],
serverHeartbeatStarted: [Function],
serverHeartbeatSucceeded: [Function],
serverHearbeatFailed: [Function],
serverOpening: [Function],
serverClosed: [Function],
topologyOpening: [Function],
topologyClosed: [Function],
topologyDescriptionChanged: [Function] },
_eventsCount: 14,
_maxListeners: undefined,
s:
{ options: [Object],
callbacks: [Object],
logger: [Object],
state: 'connected',
reconnect: true,
reconnectTries: 30,
reconnectInterval: 1000,
emitError: true,
currentReconnectRetry: 30,
ismaster: [Object],
readPreferenceStrategies: undefined,
authProviders: [Object],
id: 0,
topologyId: -1,
tag: undefined,
disconnectHandler: [Object],
monitoring: false,
haInterval: 10000,
wireProtocolHandler: [Object],
Cursor: [Object],
bsonInstance: {},
inquireServerStateTimeout: null,
bson: {},
pool: [Object],
isMasterLatencyMS: 8,
inTopology: false,
serverDetails: [Object],
serverDescription: null,
topologyDescription: null },
hashedName: '1309e35791f04f1f4fc35d5e683e81d350dd04f4',
name: [Getter],
bson: [Getter],
wireProtocolHandler: [Getter],
id: [Getter] },
cursorState:
{ cursorId: null,
cmd:
{ find: 'kard_development.kard_bonus',
limit: 0,
skip: 0,
query: [Object],
slaveOk: false },
documents: [],
cursorIndex: 0,
dead: false,
killed: false,
init: false,
notified: false,
limit: 0,
skip: 0,
batchSize: 1000,
currentLimit: 0,
transforms: undefined },
callbacks: null,
logger: { className: 'Cursor' },
_readableState:
ReadableState {
objectMode: true,
highWaterMark: 16,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
ended: false,
endEmitted: false,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain:
Domain {
domain: null,
_events: { error: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
members: [] },
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
s:
{ numberOfRetries: 5,
tailableRetryInterval: 500,
currentNumberOfRetries: 5,
state: 0,
streamOptions: {},
bson: {},
ns: 'kard_development.kard_bonus',
cmd:
{ find: 'kard_development.kard_bonus'
I'm not sure what this ouput is. I would like to skype with someone
``
Readable { pool: null, server: null, disconnectHandler: { s: { storedOps: [], storeOptions: [Object], topology: [Object] }, length: [Getter] }, bson: {}, ns: 'kard_development.kard_bonus', cmd: { find: 'kard_development.kard_bonus', limit: 0, skip: 0, query: { bank: 'Chase' }, slaveOk: false }, options: { skip: 0, limit: 0, raw: undefined, hint: null, timeout: undefined, slaveOk: false, db: EventEmitter { domain: null, _events: [Object], _eventsCount: 6, _maxListeners: undefined, s: [Object], serverConfig: [Getter], bufferMaxEntries: [Getter], databaseName: [Getter], _listening: true }, promiseLibrary: [Function: Promise], disconnectHandler: { s: [Object], length: [Getter] } }, topology: EventEmitter { domain: null, _events: { reconnect: [Function], timeout: [Object], error: [Object], close: [Function], destroy: [Object], serverDescriptionChanged: [Function], serverHeartbeatStarted: [Function], serverHeartbeatSucceeded: [Function], serverHearbeatFailed: [Function], serverOpening: [Function], serverClosed: [Function], topologyOpening: [Function], topologyClosed: [Function], topologyDescriptionChanged: [Function] }, _eventsCount: 14, _maxListeners: undefined, s: { options: [Object], callbacks: [Object], logger: [Object], state: 'connected', reconnect: true, reconnectTries: 30, reconnectInterval: 1000, emitError: true, currentReconnectRetry: 30, ismaster: [Object], readPreferenceStrategies: undefined, authProviders: [Object], id: 0, topologyId: -1, tag: undefined, disconnectHandler: [Object], monitoring: false, haInterval: 10000, wireProtocolHandler: [Object], Cursor: [Object], bsonInstance: {}, inquireServerStateTimeout: null, bson: {}, pool: [Object], isMasterLatencyMS: 8, inTopology: false, serverDetails: [Object], serverDescription: null, topologyDescription: null }, hashedName: '1309e35791f04f1f4fc35d5e683e81d350dd04f4', name: [Getter], bson: [Getter], wireProtocolHandler: [Getter], id: [Getter] }, cursorState: { cursorId: null, cmd: { find: 'kard_development.kard_bonus', limit: 0, skip: 0, query: [Object], slaveOk: false }, documents: [], cursorIndex: 0, dead: false, killed: false, init: false, notified: false, limit: 0, skip: 0, batchSize: 1000, currentLimit: 0, transforms: undefined }, callbacks: null, logger: { className: 'Cursor' }, _readableState: ReadableState { objectMode: true, highWaterMark: 16, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: null, ended: false, endEmitted: false, reading: false, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: null, encoding: null }, readable: true, domain: Domain { domain: null, _events: { error: [Function] }, _eventsCount: 1, _maxListeners: undefined, members: [] }, _events: {}, _eventsCount: 0, _maxListeners: undefined, s: { numberOfRetries: 5, tailableRetryInterval: 500, currentNumberOfRetries: 5, state: 0, streamOptions: {}, bson: {}, ns: 'kard_development.kard_bonus', cmd: { find: 'kard_development.kard_
I'm not sure what this ouput is. I would like to skype with someone
David Richardson
@daverich204
Jul 11 2016 16:28
I'm having some issues when trying to use the bulk API for inserting/updating items in a collection with a 'unique' key set. No matter what parameters I am using, I keep getting "E11000 Dupe Key" errors. I've got some of the code I've been using here: http://stackoverflow.com/questions/38276461/mongodb-bulk-upsert-throwing-e11000-duplicate-key-error
smahi
@smahi
Jul 11 2016 18:50
Hi, how to find out how many items Model.aggregate result will be ?
nacq
@nacq
Jul 11 2016 18:53
@smahi you can use $sum inside the $group stage
smahi
@smahi
Jul 11 2016 18:54
@nacq thank you very much.