Nullable types in documents

Nov 5, 2015 at 10:36 AM
Edited Nov 5, 2015 at 10:40 AM
Hi,

Is there any recommended way to use documents with nullable types?

Like:
    public class Doc
    {
        #region ctor

        public Doc()
        {
            this.ID = Guid.NewGuid();
        }

        #endregion

        #region public properties

        public Guid ID
        {
            get;
            set;
        }

        public Int32? Value
        {
            get;
            set;
        }


        #endregion
    }
    
    public class DocSchema : RDBSchema
    {
        public Int32? Value
        {
            get;
            set;
        }
    }
    
    [RegisterView]
    public class DocView : RaptorDB.View<Doc>
    {
        #region internal structures

        #endregion

        #region constructor

        public DocView()
        {
            this.Name = "DocView";
            this.Description = "documents view";
            this.isPrimaryList = true;
            this.BackgroundIndexing = true;
            this.ConsistentSaveToThisView = true;
            this.Schema = typeof(DocSchema);
            this.TransactionMode = false;
            this.Version = 1;
            this.DeleteBeforeInsert = false;
            this.Mapper = (api, docid, doc) =>
            {
                api.EmitObject(docid, doc);
            };
        }

        #endregion
    }
I am using this and it crashes with an exception during indexing:
"GenericArguments[0], 'System.Nullable`1[System.Int32]', on 'RaptorDB.TypeIndexes`1[T]' violates the constraint of type 'T'."
Am I doing something wrong?

Thanks.
Nov 5, 2015 at 10:43 AM
Currently RaptorDB does not handle null values. (The indexes have no support for it).