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
I am using the following server side code to test with the C# code provided in the documentation.
/server/main.js
import { Meteor } from 'meteor/meteor';
collection = new Mongo.Collection('collectionName')
Meteor.methods({
'getStringMethod':function(){
return "HELLO WORLD"
}
});
Meteor.publish('subscriptionEndpointName',function(){
return collection.find()
});
Meteor.startup(() => {
// code to run on server at startup
});
Then I inserted an empty document in meteor mongodb.
db.collectionName.insert({})
But I got an error in Unity.
NullReferenceException: Object reference not set to an instance of an object
Meteor.Collection`1[main+DocumentType].Meteor.Internal.ICollection.Added (System.String messageText) (at Assets/Meteor-Unity/LiveData/Collection.cs:211)
Meteor.Internal.LiveData.HandleOnTextMessageRecv (System.String socketMessage) (at Assets/Meteor-Unity/LiveData/LiveData.cs:334)
Meteor.Internal.LiveData+<Dispatcher>c__Iterator4.MoveNext () (at Assets/Meteor-Unity/LiveData/LiveData.cs:205)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
There is no problem to insert documents via a meteor method but this error is prompted when I insert documents via meteor mongo directly.
The text was updated successfully, but these errors were encountered:
msvmsv123
changed the title
Request for adding Meteor server side and MongoDB code example to the documentation
Cannot insert document directly from meteor mongodb
Jun 12, 2017
I am using the following server side code to test with the C# code provided in the documentation.
/server/main.js
Then I inserted an empty document in meteor mongodb.
But I got an error in Unity.
There is no problem to insert documents via a meteor method but this error is prompted when I insert documents via meteor mongo directly.
The text was updated successfully, but these errors were encountered: