Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-880

Cannot query when having a regular expression in MongoDB Document

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.1
    • Affects Version/s: 1.0.0-rc2
    • Component/s: BSON
    • None

      I have a document and an object below:

       

      {
       "_id" : ObjectId("5c7642f49bd4e700332e82ea"),
       "name" : "Favorite",
       "reg" : /^L0F1[a-zA-Z0-9]*$/m
      }
      

       

      type Test struct {
        ID   primitive.ObjectID `bson:"_id,omitempty" json:"id"`
        Name string             `bson:"name,omitempty" json:"name"`
      }

       

      When I unmarshal the document to my object, I got attempted to read bytes of unknown BSON type invalid error.

       

            Assignee:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Reporter:
            thaoht Huynh Thanh Thao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: