Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7807953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:00:47+00:00 2026-06-02T03:00:47+00:00

Backbone,Node : when i call fetch method, fetch is successful in server but when

  • 0

Backbone,Node : when i call fetch method, fetch is successful in server but when it sends response back using

res.send(result)

it is not sending(may be) any model or it is sending old model back,and it is sending only response object . Model is what i want, how can i get ?

app.get('/college/colleges/:_id', function (req, res) {

    oid = new ObjectID(req.params._id.toString());
    return CollegeModel.find({
        _id: oid
    }, function (err, result) {
        if (!err) {
            console.log("Fetched college model successfully");
            res.send(result);
        } else {

            console.log("Error : " + err);
            res.send(err);

        }
    });
});

the above code is in node . Below one is in client javascript (in a view).

college_model = new CollegeModel(id)
college_model.fetch({
    success = function (model, res, options) {
        console.log model // here , new model should come with all new attributes, but old model with only id attribute is appearing here,,,in model format.
        console.log res // here, i am getting all required records in objectformat,no problem for this res
    }
    error = function (model, res, options) {
        console.log("Error ");
    }

})

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:00:48+00:00Added an answer on June 2, 2026 at 3:00 am

    got the answer

    instead of sending

             res.send(result);
    

    send like this :

             res.send(result[0]);
    

    then the result will be fine !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using node.js and backbone for a web app. Backbone is part of my
I use node.js/ejs on the server side and backbone.js on the client side. Both
Using Backbone I can fetch the Collection like below and render a Backbone View
I am building a backbone.js app on a Rails 3.1 back-end. I'm using CoffeeScript
I'm building an app with backbone/RequireJs on the front end and node/express on the
I am building a small app that uses backbone.js on the client side, node.js/socket.io
Backbone.js makes a POST request when a new model is created and saved, but
I'm new to backbone and trying to set it up in Sinatra, but I
I'm using backbone with the backbone-rails gem which does its own templating and project
I use it on the client right now with Backbone.js, but I'd like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.