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

  • Home
  • SEARCH
  • 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 8135211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:20:51+00:00 2026-06-06T10:20:51+00:00

I have a collection of user models that starts with basic data: [ {‘_id’:

  • 0

I have a collection of user models that starts with basic data:

[
 {'_id': 1, 'username': 'Jamie', 'image': 'jamie.jpg'},
 {'_id': 2, 'username': 'Andrew', 'image': 'andrew.jpg'},
 {'_id': 3, 'username': 'Kerry', 'image': 'kerry.jpg'}
];

but when a user clicks on the collection models view I load more data into the model so then I can create a profile view of the data:

{
 '_id'      : 1,
 'username' : 'Jamie',
 'image'    : 'jamie.jpg',
 'age'      : 21,
 'country'  : 'UK'
};

I have set it up so that when the full profile data has been loaded it wont be fetched again to save on GET requests.

However I have a refresh button on the main users view so and when I refresh the data all the loaded profile data is gone and I am required to make GET requests to get the information back.

I was wondering how I would go about solving this problem.

More details:

The purpose of the refresh button is to add new online users. I want this button so users who want to see new data will use this instead of refreshing the whole page.

The problem with wiping the loaded data is when a user goes back to the profile (which will happen a lot because I am going to add the ability to chat on each profile which requires the user to be on that users profile) there is an unnecessary GET requests because the data has already been loaded previously in the users session.

  • 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-06T10:20:54+00:00Added an answer on June 6, 2026 at 10:20 am

    Running .fetch({add:true}) would avoid overwriting existing models, but then you’d be left with duplicates. To weed out duplicates and add new models to the collection, you’ll need to combine .fetch({add:true}) with a custom parse() function:

    parse: function(response) {
    
      var client_ids = _.map(allUsers,function(user){ return user.get('id'); });
    
      response = _.filter(response,function(user){
        // true if user is not already in collection
        return _.indexOf(client_ids,user.id) < 0; 
      });
    
      return response;
    }
    

    I don’t have any way to test this right now, so please try it out and let me know if it works.

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

Sidebar

Related Questions

So, I have a collection called: 'members' and in that I have a user
I have a user control that contains a collection of controls to be reused
I have a table that is a collection entries as to when a user
I have an User entity in my applications set of models that is defined
I have one observable collection with user control. And I am bind it in
I have two classes and mapping for the collection: class User { Guid ID;
I have created a site collection inside a web application with user A as
I have multiple Users, each with a collection of Tasks. public class User {
I have a combo box that I bind to an observable collection, which gets
Here is my problem. I have a list of models that are displayed 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.