modernistik / parse-stack

Parse Server Ruby Client SDK
https://www.modernistik.com/gems/parse-stack/
MIT License
61 stars 20 forks source link

Use MonGo As Schema ☻ #8

Closed ghost closed 8 years ago

ghost commented 8 years ago

@apersaud can we use mongo schema as model?

with example:

`class Book1 < Parse::Object
 include Mongoid::Document
 field :title, type: String
 field :publisher, type: String
 field :published_on, type: Date
 field :votes, type: Array
 belongs_to :author
 has_and_belongs_to_many :categories
 embeds_many :reviews
end

instead of :

`class Book1 <  Parse::Object
  property :title
  property :publisher
  property :audio_file, :file
  property :published_on, :Date
  property  :votes, :Array
  belongs_to :author
  has_many :likes, as: :user, through: :relation
end

output of mongo is Json , if we interpret mongo Json as parse server input , can we use mongo options?

like has_and_belongs_to_many we have not in parse::object

apersaud commented 8 years ago

You might have a conflict if you try and use both Parse::Object and Mongoid::Document in the same class - as they might override each other's methods. The only options supported by Parse::Stack are documented in our wiki. Using Mongoid implies that the adapter will go directly to the MongoDB database instead of using the Parse Rest API.