@@ -113,14 +113,14 @@ $response = DB::table('ProductCatalog')
113
113
#### PutItem
114
114
115
115
``` php
116
- $item = DB::table('Thread')
117
- ->putItem([
118
- 'ForumName' => 'Amazon DynamoDB',
119
- 'Subject' => 'New discussion thread',
120
- 'Message' => 'First post in this thread',
121
- 'LastPostedBy' => '
[email protected] ',
122
- 'LastPostedDateTime' => '201603190422'
123
- ]);
116
+ $response = DB::table('Thread')
117
+ ->putItem([
118
+ 'ForumName' => 'Amazon DynamoDB',
119
+ 'Subject' => 'New discussion thread',
120
+ 'Message' => 'First post in this thread',
121
+ 'LastPostedBy' => '
[email protected] ',
122
+ 'LastPostedDateTime' => '201603190422'
123
+ ]);
124
124
```
125
125
126
126
#### UpdateItem
@@ -171,9 +171,9 @@ DB::table('Thread')
171
171
Use ` select ` clause for Projection Expressions.
172
172
173
173
``` php
174
- $item = DB::table('ProductCatalog')
175
- ->select('Price', 'Title')
176
- ->getItem(['Id' => 101]);
174
+ $response = DB::table('ProductCatalog')
175
+ ->select('Price', 'Title')
176
+ ->getItem(['Id' => 101]);
177
177
```
178
178
179
179
### Condition Expressions
@@ -227,23 +227,23 @@ DB::table('ProductCatalog')
227
227
Use ` keyCondition ` clause to build Key Conditions.
228
228
229
229
``` php
230
- $items = DB::table('Thread')
231
- ->keyCondition('ForumName', '=', 'Amazon DynamoDB')
232
- ->query();
230
+ $response = DB::table('Thread')
231
+ ->keyCondition('ForumName', '=', 'Amazon DynamoDB')
232
+ ->query();
233
233
```
234
234
235
235
``` php
236
- $items = DB::table('Thread')
237
- ->keyCondition('ForumName', '=', 'Amazon DynamoDB')
238
- ->keyCondition('Subject', '=', 'DynamoDB Thread 1')
239
- ->query();
236
+ $response = DB::table('Thread')
237
+ ->keyCondition('ForumName', '=', 'Amazon DynamoDB')
238
+ ->keyCondition('Subject', '=', 'DynamoDB Thread 1')
239
+ ->query();
240
240
```
241
241
242
242
``` php
243
- $items = DB::table('Reply')
244
- ->keyCondition('Id', '=', 'Amazon DynamoDB#DynamoDB Thread 1')
245
- ->keyCondition('ReplyDateTime', 'begins_with', '2015-09')
246
- ->query();
243
+ $response = DB::table('Reply')
244
+ ->keyCondition('Id', '=', 'Amazon DynamoDB#DynamoDB Thread 1')
245
+ ->keyCondition('ReplyDateTime', 'begins_with', '2015-09')
246
+ ->query();
247
247
```
248
248
249
249
#### Filter Expressions for Query
@@ -253,11 +253,11 @@ Use `filter` clause to build Filter Conditions.
253
253
For ` query ` , KeyConditionExprssion is required, so we specify both KeyConditionExpression and FilterExpression.
254
254
255
255
``` php
256
- $itmes = DB::table('Thread')
257
- ->keyCondition('ForumName', '=', 'Amazon DynamoDB')
258
- ->keyCondition('Subject', '=', 'DynamoDB Thread 1')
259
- ->filter('Views', '>', 3)
260
- ->query();
256
+ $response = DB::table('Thread')
257
+ ->keyCondition('ForumName', '=', 'Amazon DynamoDB')
258
+ ->keyCondition('Subject', '=', 'DynamoDB Thread 1')
259
+ ->filter('Views', '>', 3)
260
+ ->query();
261
261
```
262
262
263
263
### Working with Scans in DynamoDB
@@ -267,9 +267,9 @@ $itmes = DB::table('Thread')
267
267
#### Filter Expressions for Scan
268
268
269
269
``` php
270
- $items = DB::table('Thread')
271
- ->filter('LastPostedBy', '=', 'User A')
272
- ->scan();
270
+ $response = DB::table('Thread')
271
+ ->filter('LastPostedBy', '=', 'User A')
272
+ ->scan();
273
273
```
274
274
275
275
### Using Global Secondary Indexes in DynamoDB
@@ -281,11 +281,11 @@ $items = DB::table('Thread')
281
281
Use ` index ` clause to specify IndexName.
282
282
283
283
``` php
284
- $items = DB::table('Reply')
285
- ->index('PostedBy-Message-index')
286
- ->keyCondition('PostedBy', '=', 'User A')
287
- ->keyCondition('Message', '=', 'DynamoDB Thread 2 Reply 1 text')
288
- ->query();
284
+ $response = DB::table('Reply')
285
+ ->index('PostedBy-Message-index')
286
+ ->keyCondition('PostedBy', '=', 'User A')
287
+ ->keyCondition('Message', '=', 'DynamoDB Thread 2 Reply 1 text')
288
+ ->query();
289
289
```
290
290
291
291
## Authentication (Custom User Provider)
@@ -406,7 +406,7 @@ class AuthUserProvider implements BaseUserProvider
406
406
*/
407
407
public function retrieveById($identifier)
408
408
{
409
- $item = DB::table('User')->getItem(['id' => $identifier]);
409
+ $item = DB::table('User')->getItem(['id' => $identifier])['Item'] ;
410
410
411
411
return new User($item);
412
412
}
0 commit comments