Collection.findOne asynchronous?

I read somewhere that I can write code for database queries in meteor in a synchronous manner.

var conversation = Meteor.conversations.findOne({
          id: this.props.conversationId,
        });

        conversation.sendMessage(this.state.message);

When I run the above code fragment, it returns the following error:

Uncaught TypeError: Cannot read property ‘sendMessage’ of undefined.

Why is this? Should I move the conversation.sendMessage part to a callback?
Please help!

That’s correct. However, if you are doing this on the client, you do need to ensure that the collection is ready. Typically, you would subscribe (on the client) to a publication (on the server), and then check in the client for the readiness of the subscription. Check basic pub/sub here.

Also, the query part of your find uses id, which may not be what you intended - did you mean _id?