# String

String fields store Unicode text, utilizing the native Unicode representation for your version of Python. (On Python 2: `unicode`, on Python 3: `str`.)

### Import

`from marrow.mongo.field import String`

### Inherits

`marrow.mongo:`**`Field`**

## Attributes

This field type inherits all [`Field` attributes](https://github.com/marrow/mongo/tree/128b1ec81ec6a48e05a95c32b636deede377854b/reference/field/field.md#attributes) and represents a singular, scalar Unicode string value. In addition to the basic attributes, String fields can automatically strip extraneous whitespace on assignment or perform case normalization, e.g. automatic execution of `str.upper()`, `str.lower()`, or `str.title()`.

### `strip`

Either the boolean literal `True` or a string representing the argument to `str.strip`, that is, the characters to strip.

Default`False`

Added`>=1.1.1`

### `case`

Truthy values (or the string literal `"u"` or `"upper"`) will request uppercase normalization, falsy values (or the literals `"l"` or `"lower"`) request lowercase normalization, or the literal `"title"` can be used to request title case.

Default`None`

Added`>=1.1.1`

## Usage

Instantiate and assign an instance of this class during construction of a new `Document` subclass. Accessing as a class attribute will return a Queryable allowing string filtering operations, and access as an instance attribute will return a `str` (or `unicode` on Python 2) cast value.

## See Also

* [`Binary`](/reference/fields/binary.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mongo.webcore.io/reference/fields/string.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
