This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-15
Channels
- # alda (4)
- # beginners (9)
- # boot (2)
- # cider (56)
- # cljsrn (6)
- # clojure (29)
- # clojure-belgium (2)
- # clojure-gamedev (1)
- # clojure-russia (19)
- # clojure-uk (3)
- # clojurescript (7)
- # core-async (2)
- # datomic (16)
- # hoplon (96)
- # lein-figwheel (4)
- # om (2)
- # om-next (3)
- # other-languages (6)
- # planck (11)
- # reagent (9)
- # rethinkdb (1)
- # ring-swagger (1)
- # spacemacs (1)
is it possible to have a "polymorphic" endpoint?
For example, imagine I have a schema for a User
that contains a BasicInfo
schema, a MediaOwned
schema, and a BooksOwned
schema, and these update to a MongoDB.
Example User
:
{:_id <Mongo's ObjectID>
:name "joe"
:address "123 sesame st."
{:books ["harry potter", "lord of the flies", "the tipping point"]
:videos []}}
Imagine I want to update the User, but I only want to submit an User ID and some books at PUT
"/api/user"
. It would be cool if that endpoint could accept Books, or an entire Media, or the whole shebang, a User, and update only the relevant parts. Does that make sense? So the body of a request on this endpoint could be one of a few different schemas. Possible? Or should I just make a few different endpoints? (this sounds a little like the small amount I understand about datomic
, just updating relevant parts of objects...)