相关疑难解决方法(0)

如何将HTML插入Mongodb?

当我尝试粘贴HTML文本文件时,我一直被踢出shell.如何才能做到这一点?我首先需要使用一些javascript来编码它吗?

例:

db.test.insert({x:"<div id='product-description'><p>Who hasn’t wished for a mini-Roomba to    handle the arduous task of cleaning their iPhone screen? Now your dreams have come true!</p>  <p>See the Takara web page for a <a href='http://www.takaratomy.co.jp/products/automee/'  title='automee s' target='_blank'>demo video.</a></p>
<p><strong>Colors: </strong> White, Red, Orange and Blue<br>
Runs on a single AA battery.</p>
<p>1,575 yen</p><!-- end #product-description --></div>"})
Run Code Online (Sandbox Code Playgroud)

编辑

我在我的html中只放了一个引号并用双引号包装整个东西,但仍然没有好处.shell错误:

> j = ({z:"<div id='product-description'><p>Who hasn
---
Unicode text could not be correctly displayed.
Please change your console font to a Unicode …
Run Code Online (Sandbox Code Playgroud)

javascript json mongodb

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

标签 统计

javascript ×1

json ×1

mongodb ×1