func (rp Regex) IsZero() bool {
	return rp.Pattern == "" && rp.Options == ""
}
IsZero returns if rp is the empty Regex
package primitive  
import (
	"bytes"
	"encoding/json"
	"fmt"
	"time"
)
type Binary struct {
	Subtype byte
	Data    []byte
}
func (bp Binary) Equal(bp2 Binary) bool {
	if bp.Subtype != bp2.Subtype {
		return false
	}
	return bytes.Equal(bp.Data, bp2.Data)
}
func (bp Binary) IsZero() bool {
	return bp.Subtype == 0 && len(bp.Data) == 0
}
type Undefined struct{}
type DateTime int64
var _ json.Marshaler = DateTime(0)
var _ json.Unmarshaler = (*DateTime)(nil)
func (d DateTime) MarshalJSON() ([]byte, error) {
	return json.Marshal(d.Time())
}
func (d *DateTime) UnmarshalJSON(data []byte) error {
	if string(data) == "null" {
		return nil
	}
	var tempTime time.Time
	if err := json.Unmarshal(data, &tempTime); err != nil {
		return err
	}
	*d = NewDateTimeFromTime(tempTime)
	return nil
}
func (d DateTime) Time() time.Time {
	return time.Unix(int64(d)/1000, int64(d)%1000*1000000)
}
func NewDateTimeFromTime(t time.Time) DateTime {
	return DateTime(t.Unix()*1e3 + int64(t.Nanosecond())/1e6)
}
type Null struct{}
type Regex struct {
	Pattern string
	Options string
}
func (rp Regex) String() string {
	return fmt.Sprintf(`{"pattern": "%s", "options": "%s"}`, rp.Pattern, rp.Options)
}
func (rp Regex) Equal(rp2 Regex) bool {
	return rp.Pattern == rp2.Pattern && rp.Options == rp2.Options
}