12345678910111213141516171819202122 |
- package repo
- import (
- "mats/db/model"
- "go.mongodb.org/mongo-driver/bson/primitive"
- )
- func Env3dGetById(ctx *RepoSession, id string, project []string) *model.Env3d {
- eid, _ := primitive.ObjectIDFromHex(id)
- option := DocSearchOptions{
- CollectName: CollectionEvn3d,
- Query: Map{"_id": eid},
- Project: project,
- }
- env3d := &model.Env3d{}
- ok, err := RepoSeachDoc(ctx, &option, env3d)
- if err != nil || !ok {
- return nil
- }
- return env3d
- }
|