How are polymorphic fields handled in RethinkDB? -


say have field a values:

  • "some string"
  • 12
  • ["i'm array"]
  • {"great": "also object"}

how work? (if @ all)

i.e: in elasticsearch example implicit field mapping created under covers based on first value comes in said field, if explicit mapping doesn't exist.

e.g.: if "some string" comes in first value a, a assumed contain strings on. if afterwards can't coerced string persisted, insert fail.

since rethinkdb schemaless (no field mappings), same logic apply here?

or, alternative, nothing @ assumed on type, , polymorphic values can live happily side side in same field?

nothing @ assumed on type, same field can have different type. can live happily side side. when doing query, if needs special decision based on type of field, can use branch , typeof, or pre-processing map.

you can try in data exploerer:

r.table('user').insert({f: "12"}); r.table('user').insert({f: 12})  ; r.table('user').insert({f: [12]}); r.table('user').insert({f: {v: 12}}); 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -