Skip to content

Commit

Permalink
Merge pull request #29 from contentstack/querying_with_null
Browse files Browse the repository at this point in the history
Querying with null
  • Loading branch information
ishaileshmishra authored Feb 26, 2021
2 parents 93905fc + 93bd3fa commit 0448383
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## CHANGELOG
## Version 1.5.7
###### Date: 20-Feb-2021
Document updated

#23 Fixed Issue: Querying content with `null` field
• Query: query content by specifying fields as null

## Version 1.5.6
###### Date: 27-Jan-2021
Expand Down
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ To use the Contentstack Java SDK to your existing project, perform the steps giv
<dependency>
<groupId>com.contentstack.sdk</groupId>
<artifactId>java</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
</dependency>
```

2. **Gradle**
```java
implementation 'com.contentstack.sdk:java:1.5.6'
implementation 'com.contentstack.sdk:java:1.5.7'
```

### Key Concepts for using Contentstack
Expand Down Expand Up @@ -59,7 +59,7 @@ A publishing environment corresponds to one or more deployment servers or a cont

To initialize the SDK, specify application API key, access token, and environment name of the stack as shown in the snippet given below:
```java
Stack stack = Contentstack.stack( "apiKey", "accessToken", "environment_name");
Stack stack = Contentstack.stack( "APIKey", "accessToken", "environment_name");
```
To get the API credentials mentioned above, log in to your Contentstack account and then in your top panel navigation, go to Settings &gt; Stack to view the API Key and Access Token.

Expand All @@ -73,13 +73,13 @@ To retrieve a single entry from a content type use the code snippet given below:
ContentType contentType = stack.contentType("content_type_uid");
Entry blogEntry = contentType.entry("entry_uid");
blogEntry.fetch(new EntryResultCallBack() {
@Override
public void onCompletion(ResponseType responseType, Error error) {
if (error == null) {
[Success block]
} else {
[Error block]
}}
@Override
public void onCompletion(ResponseType responseType, Error error) {
if (error == null) {
//Success block
} else {
//Error block
}}
});
```
##### Get Multiple Entries
Expand All @@ -90,13 +90,14 @@ To retrieve multiple entries of a particular content type, use the code snippet
//stack is an instance of Stack class
Query blogQuery = stack.contentType("content_type_uid").query();
blogQuery.find(new QueryResultsCallBack() {
@Override
publicvoidonCompletion(ResponseType responseType, QueryResult queryResult, Error error) {
if(error == null){
[Success block]
}else{
[Error block]
}}});
@Override
public void onCompletion(ResponseType responseType, QueryResult queryResult, Error error) {
if(error == null){
//Success block
}else{
//Error block
}}
});
```


Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.contentstack.sdk</groupId>
<artifactId>java</artifactId>
<version>1.5.6</version>
<version>1.5.7</version>
<packaging>jar</packaging>
<name>contentstack-java</name>
<description>Java SDK for Contentstack Content Delivery API, Contentstack is a headless CMS with an API-first approach
Expand Down

0 comments on commit 0448383

Please sign in to comment.