第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我可以使用什么來代替DB。哪里

我可以使用什么來代替DB。哪里

Go
郎朗坤 2022-10-04 19:43:56
在Gorm中,我們可以使用從數(shù)據(jù)庫中檢查用戶的數(shù)據(jù)以進行身份驗證。但是我必須使用Go Fiber,所以我可以用什么來代替來檢查用戶是否存在于數(shù)據(jù)庫中。DB.WhereDB.Wherevar user models.User     database.DB.Where("id = ?", claims.Issuer).(&user)
查看完整描述

2 回答

?
一只斗牛犬

TA貢獻1784條經(jīng)驗 獲得超2個贊

好吧,根據(jù)您的問題,gorm正在作為數(shù)據(jù)庫和框架工作。

你可以使用go fiber作為框架,但是如果你想使用數(shù)據(jù)庫,你不能使用來自fiber的數(shù)據(jù)庫,而必須使用一個數(shù)據(jù)庫,你可以從中找到數(shù)據(jù)庫中的數(shù)據(jù)集合。

例如,您正在將MongoDB與GoFiber一起使用,因此它將使用以下方法:DB.Collection.FindOne()

在 Db.窗體中,用于查找數(shù)據(jù)庫集合


查看完整回答
反對 回復 2022-10-04
?
小怪獸愛吃肉

TA貢獻1852條經(jīng)驗 獲得超1個贊

Well, as per your question gorm is working as a database also as a framework.


you can use go fiber as a framework but if you want to use the database you cannot use the database from fiber instead you have to use a database from which you can find the collection of the data in the database.


For example, you are using MongoDB with GoFiber so it will use the method of DB.Collection.FindOne()


In form Db.Where is used to find the database collection


查看完整回答
反對 回復 2022-10-04
  • 2 回答
  • 0 關注
  • 119 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號