it is my client-demo. I want to get all doc in the "file" collection. but i get null
I use the mongo shell to test it. I find the doc data exists
I'm sure the client connects to server successfully. cause when i invoke connection.get('file','test'), console log is the same as mongo shell. log text (Delta { ops: [ { insert: 'Hi!12323232' } ] })
i expected that query.results is an array contains correct docs.
I find the answer in the sharedb document I should add the ready event callback: