Listing All Items

In the previous section, you added items to the domain. This section provides examples of how to list all items within the domain.

The following sample code snippets demonstrate listing all items within a domain.

Java

To run the sample

  1. Open a clean copy of QuerySample.java.

  2. Remove any comment marks from the invokeQuery(service, request); line and add the following line after // @TODO: set request parameters here:

    request.withDomainName("MyStore");
  3. Compile and run the sample.

    Amazon SimpleDB returns all items within the domain.

C#

To run the sample

  1. Open AmazonSimpleDBSamples.cs.

  2. Comment out the code you added in the previous section.

  3. Replace the Query Action section with the following:

    Query queryAction = new Query().WithDomainName("MyStore");
    QuerySample.InvokeQuery(service, queryAction);
    
  4. Run the sample.

    Amazon SimpleDB returns all items within the domain.

Perl

To run the sample

  1. Open a clean copy of QuerySample.pl.

  2. Remove any comment marks from the invokeQuery($service, $request); line and add the following lines after the // @TODO: set request line:

    my $request = Amazon::SimpleDB::Model::Query->new({
    DomainName=> "MyStore"
    });
    
  3. Run the sample.

    Amazon SimpleDB returns all items within the domain.

PHP

To run the sample

  1. Open a clean copy of QuerySample.php.

  2. Remove any comment marks from the invokeQuery($service, $request); line and add the following lines after the // @TODO: set request line:

    $request = new Amazon_SimpleDB_Model_Query();
    $request->setDomainName('MyStore');
    
  3. Run the sample.

    Amazon SimpleDB returns all items within the domain.

VB.NET

To run the sample

  1. Open AmazonSimpleDBSamples.vb.

  2. Comment out the code you added in the previous section.

  3. Replace the Query Action section with the following:

    Dim listAllItemsAction As New Query()
    listAllItemsAction.WithDomainName("MyStore")
    
    QuerySample.InvokeQuery(service, listAllItemsAction)
    
  4. Run the sample.

    Amazon SimpleDB returns all items within the domain.

Scratchpad

To run the sample

  1. Open the scratchpad application with a web browser.

  2. Select Query from the Explore API list box.

  3. Enter MyStore in the Domain Name field.

  4. Leave the Query Expression field blank.

  5. To limit the number of items returned, enter a value in the Max Number Of Items field.

    If there are more items than you specified in the Max Number Of Items field, Amazon SimpleDB returns a next token.

  6. If you need to view the next page of results, enter the next token in the Next Token field.

    [Note]Note

    To get the next page of results, you only need to specify the domain name and the next token.

  7. Select from the following:

    • To invoke the request, click Invoke Request.

      Amazon SimpleDB returns all items within the domain.

    • To view the signed URL, click Display Signed URL. Then, copy and paste the signed URL into a browser.

      Amazon SimpleDB returns all items within the domain.

    • To view the string to sign, click Display String to Sign.