首页 \ 问答 \ 中文名转换为谐音英文名

中文名转换为谐音英文名

本人叫郑湘芸,女,希望能取一个和中文名字谐音的英文名,谢谢了.
更新时间:2022-04-22 22:04

最满意答案

不幸的是你要求的这个更新或查询暂时无法实现, 但可能会在将来发布的 mongoDB 3.1 版本中实现, 见 issue:  https://jira.mongodb.org/browse/SERVER-831
但幸运的是如果你想更改 Object4 的 text 或者其他 field 的值, 是可以的, 用 $ 操作符可以实现, 例如:
db.collectionName.update(
	{ id: Objectid1, 'children.id': Object4 },
	{ $set: { 'children.$.text': 'This is Object4' } }
)

在查询部分, 你可以直接使用 ArrayName.fieldName 对数组进行查找。 而在更新部分, $占位符代表你查询部分找到的数组元素, 进而children.$.text就是Object4的text值。更多内容请参阅 mongodb手册
建议:如果你是在需要对多重数组中的元素进行更新,请在 app 中得到祖父文件, 用编程语言更改数组元素, 再将祖父文件更新回数据库。

相关问答

更多
  • 可以买本《MongoDB权威指南》,这是目前仅有的比较好的翻译成中文的mongodb教程了。 至于驱动,可以去www.mongodb.org上找到。mongodb支持很多种语言的驱动程序,但是文档都是英文的,需要你有一定的英文阅读能力,因为使用驱动的过程中肯定会遇到很多问题,不查文档肯定抓瞎了。
  • 可以买本《MongoDB权威指南》,这是目前仅有的比较好的翻译成中文的mongodb教程了。 至于驱动,可以去www.mongodb.org上找到。mongodb支持很多种语言的驱动程序,但是文档都是英文的,需要你有一定的英文阅读能力,因为使用驱动的过程中肯定会遇到很多问题,不查文档肯定抓瞎了。
  • find返回的是对象,你不能遍历。只能用json方式访问。
  • 不幸的是你要求的这个更新或查询暂时无法实现, 但可能会在将来发布的 mongoDB 3.1 版本中实现, 见 issue: https://jira.mongodb.org/browse/SERVER-831 但幸运的是如果你想更改 Object4 的 text 或者其他 field 的值, 是可以的, 用 $ 操作符可以实现, 例如: db.collectionName.update( { id: Objectid1, 'children.id': Object4 }, { $set: { 'childr ...
  • 您可以编写如下查询: db.collectionName.find({"param.iecode": "P1234"}) You can write query like: db.collectionName.find({"param.iecode": "P1234"})
  • IMO看起来像将数据导出到关系数据库可以很容易地生成报告。 但如果您仍想使用MongoDB执行此操作,则可以执行mapReduce。 https://docs.mongodb.com/manual/reference/method/db.collection.mapReduce/ 您的最后两个步骤是相同的,但改变了获取数据的方式。 IMO looks like exporting your data to a Relational Database could be easy to generate the ...
  • 您可以使用MongoDB聚合框架 。 这是一个查询,它会以所需的形式为您提供日期。 不过,我相信会有一些更好的和有效的方式来处理这个问题,但这是我想出的。 db.collection.aggregate([ {"$unwind":"$class"}, {"$unwind":"$class.people"}, {"$match": { "class.people.name":"Susan" } }, {"$group":{ "_id":"$class. ...
  • 使用带有投影的$or查询将获得大部分信息: db.collection('users').find({$or: usersToFind}).project({_id: 1}).toArray((err, docs) => { console.log(docs); }); 但排序是另一回事,因为MongoDB没有任何内置的自定义排序支持。 有关处理此问题的一些方法,请参阅此文章 。 Using an $or query with a projection will get you most of the ...
  • 如果您的服务器上有一个节点项目,那么您应该有权访问该代码。 您应该查找初始化与mongodb的连接的行。 它可以是硬编码的,也可以是环境变量。 例如,像这样: // Connection URL var url = 'mongodb://localhost:27017/myproject'; // Use connect method to connect to the server MongoClient.connect(url, function(err, db) { assert.equal(n ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。