小编Mar*_*nak的帖子

JSON Schema oneOf特色填充

如何设置JSON Schema规则以确定必须设置其中一个属性并且是必需的?

我尝试了各种方法来解决它:

{
   "id":"#",
   "required":true,
   "additionalProperties":true,
   "type":"object",
   "properties":{
      "surname":{
         "id":"surname",
         "required":true,
         "type":"string"
      },
      "oneOf":[
         {
            "$ref":"#/definitions/station_id"
         },
         {
            "$ref":"#/definitions/station"
         }
      ]
   },
   "definitions":{
      "station_id":{
         "type":"integer"
      },
      "station":{
         "type":"string"
      }
   }
}
Run Code Online (Sandbox Code Playgroud)

但它从来没有奏效.我需要做的是接受station_id什么是整数或者什么是字符串名称.

请问有办法吗?

json jsonschema

12
推荐指数
1
解决办法
5320
查看次数

PostgreSQL 不区分大小写和不区分重音的搜索

我有一个数据表,我想过滤列。例如,按用户的全名搜索用户。

\n

但是,我希望允许用户输入搜索短语时不区分大小写和重音。

\n

所以我检查了这些(以及更多)来源和问题:

\n\n

我认为非确定性排序规则可能最终是实现这一目标的正确方法,但不幸的是我不知道如何:

\n
    \n
  • 将 case_insensitive 和ignore_accents 合并为一种排序规则
  • \n
  • 如何允许仅通过此类 WHERE 中的子字符串进行搜索(例如,仅通过字符串“joh”查找“J\xc3\xb3hn Doe”),因为非确定性排序规则不支持 LIKE 或正则表达式
  • \n
  • 使用哪个索引
  • \n
\n

对于如何最终处理此类问题的任何建议,我将非常感激。

\n

谢谢!

\n

postgresql indexing search

6
推荐指数
1
解决办法
3161
查看次数

如何在Bootstrap 3中垂直对齐长标签

我的输入旁边有一个长标签,它没有垂直对齐.

是否有一些选项可以像在Bootstrap 2中那样解决它,好吗?

 <form class="form-horizontal" role="form">
  <div class="form-group">
    <label for="input1" class="col-lg-2 control-label">Labdas kjas kljas dlkjasd lksjd     el1</label>
    <div class="col-lg-10">
      <input type="text" class="form-control" id="input1" placeholder="Input1">
    </div>
  </div>
  <div class="form-group">
    <label for="input2" class="col-lg-2 control-label">Label2</label>
    <div class="col-lg-10">
      <input type="password" class="form-control" id="input2" placeholder="Input2">
    </div>
  </div>
</form>
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap twitter-bootstrap-3

5
推荐指数
1
解决办法
2495
查看次数