Definition expressions are used to filter features that are streamed to the client based on the values of attribute fields. FeatureLayer contains a setDefinitionExpression() method that is used to create the filter expression. All features that meet the specified criteria will be returned for display on the map. You can build expressions using standard SQL syntax, as seen in the code example as follows:
featureLayer.setDefinitionExpression("Magnitude>7");
You can retrieve the current definition expression using the FeatureLayer.getDefinitionExpression() method, which returns a string containing the expression.