title: cannot decode array into an ObjectID
body: <p>I have this struct and when I decode it from the database to struct I'm getting this error <code>cannot decode array into an ObjectID</code></p>
  <pre><code>type Student struct {
      ID           primitive.ObjectID   `bson:&quot;_id,omitempty&quot;`
      ...
      Hitches      []primitive.ObjectID `bson:&quot;hitches&quot;`
      ...
  }
  </code></pre>
  <p>I'm using this function to decode</p>
  <pre><code>func GetStudentByID(ID primitive.ObjectID) model.Student {
  
      // Filter
      filter := bson.M{&quot;_id&quot;: ID}
  
      // Get the collection
      studentCollection := GetStudentCollection()
  
      // The object that it will return
      student := model.Student{}
  
      // Search the database
      err := studentCollection.FindOne(context.TODO(), filter).Decode(&amp;student)
  
      if err != nil {
          fmt.Println(&quot;Student DAO &quot;, err)  &lt;----------- Error is output here
          return model.Student{}
      }
  
      return student
  }
  </code></pre>
  <p>Here is a screenshot from the MongoDB</p>
  <p><a href="https://i.stack.imgur.com/quQKj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/quQKj.png" alt="" /></a></p>