Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SampleFromMongoRecord ¶
func SampleFromMongoRecord(mr MongoRecord) responses.SampleData
func ViewModelFromMongoRecord ¶
func ViewModelFromMongoRecord(mr MongoRecord) responses.DataViewModel
Types ¶
type MongoRecord ¶
type MongoRecord struct { ObjectId string `bson:"_id,omitempty"` Description string `json:"description,omitempty"` Id string `json:"id,omitempty"` Seed string `json:"seed,omitempty"` Signature string `json:"signature,omitempty"` Timestamp string `json:"timestamp,omitempty"` TimestampISO time.Time `json:"timestampiso,omitempty"` Confidence float64 `json:"confidence"` }
func (MongoRecord) CopyForUpdate ¶
func (mr MongoRecord) CopyForUpdate() MongoRecord
CopyForUpdate is necessary when updating a document in Mongo because the ObjectId on the incoming document must be blank. If not, there will be an error indicating a collision on the already populated, immutable value in the database.
Click to show internal directories.
Click to hide internal directories.