当前位置: 首页 > wzjs >正文

搜索引擎的网站有哪些网站快速被百度收录

搜索引擎的网站有哪些,网站快速被百度收录,月夜直播视频免费观看,展厅设计制作公司会计分录文章目录 1.工具类2.依赖3.sql 本文档只是为了留档方便以后工作运维,或者给同事分享文档内容比较简陋命令也不是特别全,不适合小白观看,如有不懂可以私信,上班期间都是在得 背景:因为频繁操作json嵌套数据 PostgreSQL得…

文章目录

  • 1.工具类
  • 2.依赖
  • 3.sql

本文档只是为了留档方便以后工作运维,或者给同事分享文档内容比较简陋命令也不是特别全,不适合小白观看,如有不懂可以私信,上班期间都是在得

背景:因为频繁操作json嵌套数据 PostgreSQL得JSON操作记录(本来还有一份MongoDB得,但是因为电脑卡死机文档没保存下来,气的我已经摔键盘了,后续重新写在进行补充)

1.工具类

 
package com.xhao.PostgreSQL;import com.alibaba.fastjson2.JSON;
import com.jayway.jsonpath.JsonPath;
import org.springframework.util.ObjectUtils;/*** @author XHao*/
public class JsonUtils {/*** 删除Key** @param json 原json* @param path 链路*/public static Object processJsonDelete(Object json, String path) {return JsonPath.parse(JSON.parse(json.toString())).delete(path).json();}/*** 查询value** @param json 原json* @param path 链路*/public static Object getJsonValue(Object json, String path) {return JsonPath.parse(JSON.parse(json.toString())).read(path).toString();}/*** 更新/添加Json** @param json  原json* @param path  链路* @param value key*/public static Object processJsonUpdate(Object json, String path, Object value) {return JsonPath.parse(JSON.parse(json.toString())).set(path, value).json();}/*** 获取json路径** @param path 路径* @param key  key* @return 新json路径*/public static String getPath(String path, String key) {if (ObjectUtils.isEmpty(key)) {return getPath(path);} else if (key.matches("\\d+")) {return getPath(path) + "[" + key + "]";} else {return getPath(path) + "." + key;}}/*** 获取json路径** @param path 路径* @return 新json路径*/public static String getPath(String path) {String[] parts = path.split("-");StringBuilder jsonPath = new StringBuilder("$");for (String part : parts) {// 检查是否是数组索引(数字)if (part.matches("\\d+")) {jsonPath.append("[").append(part).append("]");} else {jsonPath.append(".").append(part);}}return jsonPath.toString();}public static void main(String[] args) {String str = "option-series-0-emphasis-textStyle";String str1 = null;System.err.println(getPath(str, str1));System.err.println(getPath(str));}
}

2.依赖

   <!-- Hibernate 类型扩展 --><dependency><groupId>com.vladmihalcea</groupId><artifactId>hibernate-types-52</artifactId><version>2.14.0</version></dependency><!-- JsonPath --><dependency><groupId>com.jayway.jsonpath</groupId><artifactId>json-path</artifactId><version>2.7.0</version></dependency><!-- PostgreSQL 驱动 --><dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId></dependency>

3.sql


//查询
SELECT json->'option'->'xAxis'->0->>'show' AS show_value
FROM "public".test
WHERE id = 1;//修改
UPDATE "public".test
SET json = jsonb_set(json, '{option,xAxis,0,show}', '55555'::jsonb)  -- 将数字55555转换为jsonb类型
WHERE id = 1;UPDATE "public".test
SET json = jsonb_set(json, '{option,xAxis,0,show}',  -- 指定路径为 option -> xAxis -> 0 -> show'true'::jsonb,           -- 新的值,直接使用数字类型转换为 jsonbtrue)                     -- 如果路径不存在,则创建该路径
WHERE id = 1;//删除keyUPDATE "public".test
SET json = jsonb_set(json, '{option,xAxis,0}', jsonb_strip_nulls(json->'option'->'xAxis'->0) - 'show')  -- 删除 show 键
WHERE id = 1;//添加
UPDATE "public".test
SET json = jsonb_set(json, '{option,xAxis,0,show}',  -- 指定路径为 option -> xAxis -> 0 -> showtrue::jsonb,          -- 新的值,必须转换为 jsonb 类型true)                     -- 如果路径不存在,则创建该路径
WHERE id = 1;

因为电脑卡死机导致调研文档得MongoDB得demo没了,我也很苦恼后续重新写的话在更新

如果点赞多,评论多会更新详细教程,待补充。

http://www.dtcms.com/wzjs/167130.html

相关文章:

  • 哪个网站有老外教做蛋糕企业营销策略分析论文
  • 公司网站建设及推广高清视频网络服务器
  • ubc网站谁做的app推广
  • 软件下载网站怎么做宁波网站推广代运营
  • 阿里巴巴网站维护要怎么做百度seo培训要多少钱
  • 北京哪个公司做网站营销推广型网站
  • 官方网站英语域名注册哪个网站好
  • 建设学校网站策划书关键词seo公司推荐
  • 绵阳 网站 建设私人浏览器
  • 做下载网站好不好做如何让百度搜索排名靠前
  • 专业网站建设出售矿泉水软文广告500字
  • web网站服务器的建设磁力狗在线引擎
  • 不同的网站前缀就是不同的域名吗浏览器2345网址导航下载安装
  • 新手去哪个网站做翻译名片seo什么意思
  • 西宁企业网站开发定制免费无代码开发平台
  • 大型网站建站公司福州短视频seo
  • 网站建设与运营推广的回报材料深圳外贸网站推广
  • 南宁网站建设seo百度竞价排名公式
  • 全国旅游大型网站建设萝卜建站
  • vr网站建设nba交易最新消息汇总
  • 省市网站建设考核标准要求网站seo设计方案案例
  • vue网站开发深圳seo关键词优化
  • 建设网站费用多少正规专业短期培训学校
  • 凡科的模板做网站谷歌官网入口
  • 大网站是用什么做html5的营销方式有哪些
  • 怎么做网站服务器百度下载安装免费
  • 做调查挣钱的网站网站客服系统
  • 宁夏吴忠市红寺堡建设局网站win优化大师有免费版吗
  • 网站建设基本流程流程图掉发脱发严重是什么原因
  • 模板网站与定制网站的区别宁波seo外包哪个品牌好