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 3236920
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:40:40+00:00 2026-05-17T17:40:40+00:00

I want to sync the Core Data on iPhone with MongoDB on Sinatra server.

  • 0

I want to sync the Core Data on iPhone with MongoDB on Sinatra server.

When the iPhone gets a message from the Node.js chat server, the message contains the sender’s BSON ObjectId (a string). For the iPhone to store this message, I find the user with that same Id in Core Data. I want to be able to do something like objectWithID. In other words, I want to set the NSManagedObjectIDs to be the same as the MongoDB BSON ObjectIds. The other thing I would check is if there are no users with the sender’s id in the managedObjectContext, I will fetch him from the persistentStore, and if he’s not there, I’ll create him. This is a lot to do just to maintain the relationship between Message and Sender. Maybe I should just store the sender attribute of the Message object as his BSON ObjectId as a string instead of as a User NSManagedObject.

What do you recommend? Should I just use MongoDB on the iPhone too? I just realized there’s an Objective-C driver for it. But I was just starting to get the hang of Core Data, and it has cool things (like undo support) that I might want to use… Right now, I’m just using it for simple fetching & persistent storage, so I could replace it. But I plan to implement undo support in the future, just because I think that’s good usability. I prefer the option to undo than having to answer a confirmation pop-up, e.g., I like how GMail lets you undo a send or undo a deletion of messages, etc.

Thanks!

Matt

  • 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-05-17T17:40:40+00:00Added an answer on May 17, 2026 at 5:40 pm

    You can’t set the objectID of a core data object manually. You’ll probably want to add an attribute called externalID or something where you store the ID you got from the server.

    See this article for some thoughts on whether or not to use Core Data. Note that the author’s recommendation is to stick with Core Data in almost all cases.

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

Sidebar

Related Questions

I got a question ;) Actually I want to use core-data in different threads.
I want to make an app...that can sync my iphone calender with google calendar..i
Want my FireFox at work to be in sync with my FireFox at my
What's a good pattern, if any, to share a piece of Core Data model
Using Core Data. Let's say we have models for Team and Player. Assume: -Each
If all tables I want to delete from have the column gamer_id can i
Want to know what the stackoverflow community feels about the various free and non-free
I want to loop over the contents of a text file and do a
I want to assign the decimal variable "trans" to the double variable "this.Opacity". decimal
I want to create a Java application bundle for Mac without using Mac. According

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.