I am querying on NULL value in java (on cosmos document db) but its throwing error, below is the Syntax:
import com.azure.cosmos.models.CosmosQueryRequestOptions;
import com.azure.spring.data.cosmos.core.generator.FindQuerySpecGenerator;
import com.azure.cosmos.models.SqlQuerySpec;
import com.azure.spring.data.cosmos.core.query.CosmosQuery;
import com.azure.spring.data.cosmos.core.query.Criteria;
import com.azure.spring.data.cosmos.core.query.CriteriaType;
import org.springframework.data.repository.query.parser.Part;
import java.util.Arrays;
Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL,
"tripId",
new ArrayList(Arrays.asList(null)),
Part.IgnoreCaseType.NEVER);
CosmosQuery documentQuery = new CosmosQuery(criteria);
SqlQuerySpec sqlQuerySpec = new FindQuerySpecGenerator().generateCosmos(documentQuery);
Here is the Exception:
Exception in thread "main" java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.util.Arrays$ArrayList.(Arrays.java:3813)
at java.util.Arrays.asList(Arrays.java:3800)
question from:
https://stackoverflow.com/questions/65843885/java-azure-cosmos-query-on-null-value-is-not-supported 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…