MENU

征途所在即是星辰大海

RN ios archive issue

An alternative is to hardcode the homebrew path in the shell script. I find it less generic but certainly straightforwards.
Add this line in the very beginning of "Bundle React native code and images" build phase script:

Read More

RN集成第三方登录坑

qq-lib

改 compile

dependencies {
  implementation 'com.facebook.react:react-native:+'
  // api files('libs/open_sdk_r8353806_lite.jar')
  api files('libs/open_sdk_3.5.4.11_r3f56456_lite.jar')
}

加 exported

  <activity
            android:name="com.tencent.tauth.AuthActivity"
            android:launchMode="singleTask"
            android:exported="true"
            android:noHistory="true">

wechat

yarn add jetifier
yarn jetify

Flutter - iOS社会化分享报错

控制台输入错误信息:-canOpenURL: failed for URL: “XXX://” - error: “This app is not allowed to query for scheme XXX”
此处 XXX 为泛指,当应用集成了分享到多个平台的功能时,XXX 部分就有可能会出现多条记录。虽然有很多,但是也不用方。

Read More

mongoose查询笔记

API 概览

  • find - 异步查找表中所有符合查询条件的数据文档。(查找多条)
  • findOne - 异步查找表中第一条符合查询条件的数据文档。(查找一条)
  • findMany - 异步查找表中所有符合查询条件的数据文档。(查找多条)
  • where - 异步查找表中所有符合查询条件的数据文档,以链式的方式进行查找。(查找多条)
  • findById - 根据 id 异步查询指定数据文档(查找一条)

例子

/* 三个效果等价相同的写法 */
model.find().where("name","Yesifang").then(docs=>console.log(docs))
model.find().where("name",/^Yesifang$/).then(docs=>console.log(docs))
model.find().where("name").equals("Yesifang").then(docs=>console.log(docs))
/* 链式查询 */
model.find()
    .where("name").equals("Yesifang")
    .where("age").gte(18).lte(150)
    .then(docs=>console.log(docs))
model.find({ // 以上链式查询的等价于
    name:"Yesifang",
    age:{$gte:18,$lte:150}
}).then(docs=>console.log(docs))

查询条件

直接条件

let conditions1 = { // 查询name字段值为"Yesifang"的数据文档
    name:"Yesifang"
}
let conditions2 = { // 查询age字段值为20的数据文档
    age:20
}
let conditions3 = { // 查询name字段值为"Yesifang",并且age字段的值为20的数据文档
    name:"Yesifang",
    age:20
}

比较条件

  • $eq - 等于(equal)
  • $ne - 不等于(not equal)
  • $gt - 大于(great then)
  • $gte - 大于等于(great then equal)
  • $lt - 小于(less then)
  • $lte - 小于等于(less then equal)
  • $in - 存在(in)
  • $nin - 不存在(not in)

*以上使用方式均为: 字段:{运算符 + 表达式}

Read More