Comparison operator for the IN comparison operator.
The Python IN operator cannot be overloaded in the way we want
to, so we define a method. For example:
Employee.query(Employee.rank.IN([4,5,6]))
Note that the method is called ._IN() but may normally be invoked
as .IN(); ._IN() is provided for the case you have a
StructuredProperty with a model that has a Property named IN.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003e\u003ccode\u003eModelKey\u003c/code\u003e is a special property used for storing the Model key, inheriting from \u003ccode\u003eProperty\u003c/code\u003e, \u003ccode\u003eModelAttribute\u003c/code\u003e, and \u003ccode\u003eexpected_type\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIN()\u003c/code\u003e method facilitates the use of the \u003ccode\u003eIN\u003c/code\u003e comparison operator in queries, allowing for checks against multiple values, for example: \u003ccode\u003eEmployee.query(Employee.rank.IN([4, 5, 6]))\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSeveral comparison operators are supported, such as \u003ccode\u003e__eq__\u003c/code\u003e, \u003ccode\u003e__ge__\u003c/code\u003e, \u003ccode\u003e__gt__\u003c/code\u003e, \u003ccode\u003e__le__\u003c/code\u003e, \u003ccode\u003e__lt__\u003c/code\u003e, and \u003ccode\u003e__ne__\u003c/code\u003e, each returning a \u003ccode\u003eFilterNode\u003c/code\u003e instance representing the respective comparison.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e__neg__\u003c/code\u003e method provides a descending sort order on a property, while \u003ccode\u003e__pos__\u003c/code\u003e offers an ascending sort order, with the latter being redundant but included for consistency.\u003c/p\u003e\n"]]],[],null,["# google.appengine.ext.ndb.ModelKey\n\n\u003cbr /\u003e\n\nSpecial property to store the Model key.\n\nInherits From: [`Property`](../../../../google/appengine/ext/ndb/Property), [`ModelAttribute`](../../../../google/appengine/ext/ndb/ModelAttribute), [`expected_type`](../../../../google/appengine/api/validation/Validator/expected_type) \n\n google.appengine.ext.ndb.ModelKey()\n\nMethods\n-------\n\n### `IN`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1045-L1071) \n\n IN(\n value\n )\n\nComparison operator for the `IN` comparison operator.\n\nThe Python `IN` operator cannot be overloaded in the way we want\nto, so we define a method. For example: \n\n Employee.query(Employee.rank.IN([4, 5, 6]))\n\nNote that the method is called `._IN()` but may normally be invoked\nas `.IN()`; `._IN()` is provided for the case you have a\n`StructuredProperty` with a model that has a Property named `IN`.\n\n### `__eq__`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1020-L1022) \n\n __eq__(\n value\n )\n\nReturn a `FilterNode` instance representing the `=` comparison.\n\n### `__ge__`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1040-L1042) \n\n __ge__(\n value\n )\n\nReturn a `FilterNode` instance representing the `\u003e=` comparison.\n\n### `__gt__`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1036-L1038) \n\n __gt__(\n value\n )\n\nReturn a `FilterNode` instance representing the `\u003e` comparison.\n\n### `__le__`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1032-L1034) \n\n __le__(\n value\n )\n\nReturn a `FilterNode` instance representing the `\u003c=` comparison.\n\n### `__lt__`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1028-L1030) \n\n __lt__(\n value\n )\n\nReturn a `FilterNode` instance representing the `\u003c` comparison.\n\n### `__ne__`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1024-L1026) \n\n __ne__(\n value\n )\n\nReturn a `FilterNode` instance representing the `!=` comparison.\n\n### `__neg__`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1074-L1084) \n\n __neg__()\n\nReturn a descending sort order on this Property.\n\n#### For example:\n\n Employee.query().order(-Employee.rank)\n\n### `__pos__`\n\n[View source](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/ext/ndb/model.py#L1086-L1097) \n\n __pos__()\n\nReturns an ascending sort order on this property.\n\nNote that this is redundant but provided for consistency with\n`__neg__`. For example, the following two are equivalent: \n\n Employee.query().order(+Employee.rank)\n Employee.query().order(Employee.rank)"]]