// BSONPutMatchField choose direct match or $in automatically
BSONPutMatchField choose direct match or $in automatically
// BSONPutMatchField choose direct match or $in automatically
func BSONPutMatchField(m bson.M, key string, val []string) {
	if len(val) == 0 {
		return
	}
	if len(val) > 1 {
		m[key] = bson.M{"$in": val}
	} else {
		m[key] = val[0]
	}
	return
}
func BSONPutMatchField ( m bson . M , key string , val [ ] string ) { if len ( val ) == 0 { return } if len ( val ) > 1 { m [ key ] = bson . M { " " : val } } else { m [ key ] = val [ 0 ] } return }
BSONPutMatchField choose direct match or $in automatically
BSONPutMatchField choose direct match or $in automatically
// skip empty value // use $in for comma separated values