Can I use MongoDB as a replacement for CoreData on iOS?

前端 未结 8 1398
名媛妹妹
名媛妹妹 2021-02-01 18:32

I\'m just starting to read up on NoSQL technologies such as MongoDB and CouchDB. I\'m interested in knowing whether I can use MongoDB or indeed any NoSQL technology as a replace

8条回答
  •  长发绾君心
    2021-02-01 19:07

    For this, I recommend ObjCMongoDB. Is a library for MongoDB and BSON:

    https://github.com/paulmelnikow/ObjCMongoDB

    Features

    • Simple BSON encoding and decoding, using dictionaries.

    • Built-in support for arrays, dictionaries, embedded objects, strings, numbers, dates, object IDs, and the miscellaneous MongoDB types.

    • More complex encoding and decoding based on NSCoder's keyed coding scheme. A robust delegate interface lets you implement encoding and decoding entirely outside the model classes if necessary.

    • Automatically encodes and decodes Core Data entities. Using the coder's delegate interface you can customize the default behavior, or simply implement alternate behavior it in the entity class.

    • Aims to feel Cocoa-like, not Mongo-like. For example, method names in MongoKeyedPredicate and MongoUpdateRequest are natural in Cocoa, though they don't conform to the underlying Mongo keywords.

提交回复
热议问题