Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,16 @@ POST and PUT requests both require a JSON body payload. You can pass either a Sw
- To create a new entity in a collection (**POST**):

```swift
var entity = UsergridEntity(type: "restaurant", propertyDict: ["restaurant": "Dino's Deep Dish","cuisine": "pizza"])
var entity = UsergridEntity.init(type: "restaurant", name:"Dinos", propertyDict: ["restaurant": "Dino's Deep Dish","cuisine": "pizza"])

Usergrid.POST(entity) { response in
// entity should now have a uuid property and be created
}

// you can also POST an array of entities:

var entities = [UsergridEntity(type: "restaurant", propertyDict:["restaurant": "Dino's Deep Dish","cuisine": "pizza"]),
UsergridEntity(type: "restaurant", propertyDict:["restaurant": "Pizza da Napoli","cuisine": "pizza"])]
var entities = [UsergridEntity.init(type: "restaurant", name:"Dinos", propertyDict:["restaurant": "Dino's Deep Dish","cuisine": "pizza"]),
UsergridEntity.init(type: "restaurant", name:"Napoli", propertyDict:["restaurant": "Pizza da Napoli","cuisine": "pizza"])]

Usergrid.POST(entities) { response in
// response.entities should now contain now valid posted entities.
Expand Down