Comments (9)
@tudorels Theput
route allows you to perform a deep merge of objects. It merges the new data you provide with the existing contents of the basket.
For your use-case, perhaps look into structuring your basket with an array of users like so:
{ "users": [ { "username": "user1", "password": "pass123"}, {"username": "user2", "password": "pass234"} ] }
That way you can add new users to your array by sending a put
request with the body
{ "users": [ {"username": "user3", "password": "pass345"} ] }
The response of this put
call will be an array of 3 users.
from pantry.
Hey @tudorels, it seems like you're trying to create a basket without supplying any object as the payload. Can you please post the request payload of the POST
request?
from pantry.
https://getpantry.cloud/apiv1/pantry/myPantryID/basket/testbasket
like I saw in docs to create a basket
from pantry.
Is mandatory to insert some data in basket. I can not create an empty basket? Why?
from pantry.
Unfortunately yes, a basket cannot be empty. For now, would you be able to work around this limitation? In the meantime, I'll figure out a way to allow users to create empty baskets in their pantry.
from pantry.
It's ok for now. I'm also interested in adding new data in basket along with other data already existing in basket, like adding new record in other database system. It is posible? I've seen the other issue and you said it will be posible with put method. It will be very usefull to add new record in basket. Thanks!
from pantry.
Ok sounds good! I agree that adding new data to existing baskets is definitely useful, and ill probably go the PUT
route. Going to close this issue for now and continue discussions on this issue regarding the new update basket feature.
from pantry.
@tudorels Just an update, I've added a put
route to the API to allow users to add new data to an existing basket, you can check it out it here! Please let me know if this works better for you.
from pantry.
Maybe, I don't understand how is working ... I've made a basket "users" and I tried to add some records like this:
{ "username":"tudor", "password":"test1234$"} - this is first user
{"username":"tedi", "password":"test1234$"} -second user added with put
when I query the basket I get only second user. Maybe the basket is not like a collection. You must clarify this, how can we use this in real world. If you want to introduce a new concept nosql database, you must explain the concept and it must be made to easy understand and use. Till now I don't understand how it must work ...and how I can use this service ...
Thank you!
from pantry.
Related Issues (20)
- Fix Broken JSON Styling
- Clean up frontend templating
- Allow Users to Edit Pantry Contents via Dashboard
- Introduce Single-Point Storage Option
- Increase body-parser Request Body limit
- Add Rate Limiting
- Status Code 429 HOT 3
- Provide Users with Public(ish) URLS to Baskets HOT 2
- Minor Front/End Changes
- Add new UI Control to Refresh Basket Contents
- Display Basket Errors
- Allow Users to Change Pantry Name from Dashboard
- Module not found when deploying in heroku HOT 1
- Updating a basket via the dashboard should use POST vs. PUT
- Display Pantry Description on Dashboard
- Super slow page loading and API responses today
- Adding a failsafe when posting to a basket
- Slow Site and Timeout Errors HOT 1
- Allow view only access to a pantry/basket via pantry name + basket HOT 1
- I created a library to use Pantry from .Net HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pantry.