dotConnect for MongoDB Documentation
On this page
    SYS_COLUMNS
    On this page

    The SYS_COLUMNS table lists the columns of the tables and their parameters. The columns of a collection are the fields of its first documents (Describe Amount) and the fields of its schema validator, as the queries of the connection see them. It has the following columns:

    Column Name

    Data Type

    Description

    TABLE_CATALOG VARCHAR The name of the database of the connection.
    TABLE_SCHEMA VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    TABLE_NAME VARCHAR The name of the collection or view which the column belongs to.
    COLUMN_NAME VARCHAR The name of the column: the name of the field; a field of an embedded document or an element of an array has a dotted name (address.city, tags.0). When field names differ only in case, the column of the second spelling has a suffix (name_1).
    ORDINAL_POSITION INT The position of the column in the table.
    IS_NULLABLE VARCHAR Indicates whether this column can be NULL ("YES" or "NO"). "NO" for _id and for a NOT NULL column of a collection whose documents MongoDB checks (Schema Validation=Error).
    COLUMN_DEFAULT VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    DATA_TYPE VARCHAR The data type of the column, for example OID, VARCHAR, INT, DOUBLE, DATETIME. A column created with CREATE TABLE has the type its values are stored and read as: SMALLINT stays SMALLINT, DECIMAL(5,2) gives DOUBLE.
    CHARACTER_MAXIMUM_LENGTH INT The maximum length of the column in characters: n for a column declared as CHAR(n), NCHAR(n), VARCHAR(n) or NVARCHAR(n). NULL for other columns.
    CHARACTER_OCTET_LENGTH INT Not used in dotConnect for MongoDB. Always NULL.
    NUMERIC_PRECISION INT The precision of numeric data: p for a column declared as DECIMAL(p,s) or NUMERIC(p,s). NULL for other columns.
    NUMERIC_PRECISION_RADIX INT The precision radix of numeric data: 10 for a column declared as DECIMAL(p,s) or NUMERIC(p,s). NULL for other columns.
    NUMERIC_SCALE INT The scale of numeric data: s for a column declared as DECIMAL(p,s) or NUMERIC(p,s). NULL for other columns.
    DATETIME_PRECISION INT Not used in dotConnect for MongoDB. Always NULL.
    CHARACTER_SET_CATALOG VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    CHARACTER_SET_SCHEMA VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    CHARACTER_SET_NAME VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    COLLATION_CATALOG VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    COLLATION_SCHEMA VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    COLLATION_NAME VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    DOMAIN_CATALOG VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    DOMAIN_SCHEMA VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    DOMAIN_NAME VARCHAR Not used in dotConnect for MongoDB. Always NULL.
    ALLOWED_OPERATIONS INT

    Contains flag value that indicates which DML operations are allowed on this column and is the sum of the following flags:

    • 1 - INSERT operations are allowed
    • 2 - UPDATE operations are allowed

    3 for a column of a collection, 0 for a column of a view.

    HAS_DEFAULT BOOLEAN Indicates whether the column has the default value. Always False.
    IS_COMPUTED BOOLEAN Indicates whether the column is computed. Always False.
    IS_UNIQUE BOOLEAN Indicates whether the column must have unique values: True for _id and for a field that has a unique index on this field alone without a filter (partialFilterExpression).
    DB_TYPE INT Numeric representation of the DbType value.
    NATIVE_TYPE INT Numeric representation of the MongoDBType value.
    API_NAME VARCHAR The name of the field in MongoDB. Differs from COLUMN_NAME for a column with a suffix (name for name_1).
    IS_REQUIRED VARCHAR "YES" for _id and for a field the schema validator requires (a NOT NULL column of CREATE TABLE), whatever the validation level; "NO" otherwise.
    IS_HIDDEN BOOLEAN Indicates whether the column is hidden: SELECT * does not return it, but a query may name it. The whole value of a Binary, Timestamp, regular expression or JavaScript field that is also split into part columns (ts for ts.t and ts.i), and the fields inside a JSON column (Json Fields, Complex As String) are hidden.
    SOURCE VARCHAR Where the column comes from: "sample" - the documents read have the field; "validator" - only the schema validator declares it; "both" - both; "model" - neither, the column comes from the Entity Framework Core model.