Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

how to insert? #23

Closed
vectorselector opened this issue Feb 11, 2016 · 5 comments
Closed

how to insert? #23

vectorselector opened this issue Feb 11, 2016 · 5 comments

Comments

@vectorselector
Copy link

I don't see any documentation on how to actually use the db connection for inserting (not querying)

maybe i'm just being a noob but I think the docs should define how one is to use this db connection...

@vectorselector
Copy link
Author

ok, so aside from rest, i want to explicitly insert and i found out by guessing that there is a method called "create" papering over mongos "insert"
again, i'm a noob and probably being dumb: but why are we changing mongo verbs to fit a concept called crud?
i know the general basics of rest, but I don't understand how our http req/res and url correspond implicitly to crud... IMO these are unstated assumptions that should be made explicit.

in my case, i am uploading an image file via the multer package, and i want the metadata (path filename etc) to be inserted into a mongo collection at the same time as the upload (versus chunked upload directly into mongo...) so I simply added the line:

mongodb({db:'feathers', collection:'masterCards'}).create(req.file);

and it's working...
but this would be good to speak about, IMO

@marshallswain
Copy link
Member

feathers-mongodb is a database adapter for Feathers, which holds maintaining fully RESTful APIs as one of its primary principles. There are a couple of people currently updating this adapter to bring it up to par with the other adapters. In the meantime, I would recommend using the feathers-mongoose adapter and turning off Mongoose schemas (which is as simple as providing an empty object as your schema, I believe.) until feathers-mongodb is updated to the new API. Turning off Mongoose schemas should make it work pretty similar to this adapter.

Also, check out the Feathers docs here: http://docs.feathersjs.com.

You can find the service methods here: http://docs.feathersjs.com/services/readme.html#service-methods

@daffl
Copy link
Member

daffl commented Feb 11, 2016

We are working on the v2 docs at http://docs.feathersjs.com/ but how those methods correspond to REST and websocket calls should also be documented fairly detailed in the current documentation at http://feathersjs.com/docs/#toc10 and in the quick start guide.

@vectorselector
Copy link
Author

thanks for the info, folks

@marshallswain
Copy link
Member

http://feathersjs.com might be a better introduction to see how it works and compares to Meteor, Sails, etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants