title: Mongoose Schema for remote MongoDb
body: <p>I have opened a connection to my remote mongodb ec2 instance but now am trying to retrieve data that is nested within a collection. The database has multiple collections (ie visitor, campaign, form, etc...) and has data already in it from another source. I am using node + express for the application.</p>
  
  <p><strong>1)</strong> Do I have to define a schema in my app to match the remote database or can I just query for the data and store it in an object? 
  <a href="https://stackoverflow.com/questions/10081611/mongoose-schema-creation/10083152#10083152">mongoose schema creation</a></p>
  
  <p><strong>2)</strong> Actually retrieving the values within the visitor collection, can I just use dot notation to query within the <code>visitor</code> collection for <code>visitor_id</code> using:</p>
  
  <pre><code>db.find(visitor.visitor_id)  
  </code></pre>
  
  <p>Here is the database connection code I am using if that helps  </p>
  
  <pre><code>var uri = 'mongodb://xx.xxx.xx.x'
  var mongoOptions = { db: { safe: true } };
    db = mongoose.createConnection(uri, mongoOptions, function (err, res) {
  if (err) {
      console.log('ERROR connecting to: remote' + uri + '. ' + err);
  } else {
      console.log('Successfully connected to: remote' + uri);
     }
  });
  </code></pre>