Access Meteor.js Database from an external App

95 views
Skip to first unread message

Samsy

unread,
Feb 23, 2014, 7:34:50 AM2/23/14
to meteo...@googlegroups.com

I'm developping a Meteor App wich is connected to a larger App

I connected Socket.IO to that App, and im trying to retrieve database datas from Meteor.server to the distant client ( wich is NOT the Meteor.client ).

My Meteor app is a back office.

And i got another App i want to link with that Meteor.app

There is my server code.

On socket IO connection im trying to retrieve my Users Collection but i got no result server side :/

, but if i call on meteor client, i got my results.


Any idea on this ? 

if (Meteor.isServer) {

    Meteor.startup(function () {


var Users = new Meteor.SmartCollection("Users");
var installationDatas = null;
var socketIO = SOCKET.listen(3333);

var dataCollections = null;

Meteor.publish("Users", function() {
    return Users.find({});
}); 

Meteor.methods({
    create_user: function( name ,surname , email , password ) {


        Users.insert({name: name, surname:surname ,email:email , password : password});
        return;
    }


});  



    socketIO.sockets.on('connection', function (socket) {

        socket.on('retrieveMyDataCollection', function (data) {
            socket.emit('giveDataCollection', JSON.decycle(Users.find({name : data})));  
        });

    });  
  });




}
Reply all
Reply to author
Forward
0 new messages