-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathupdate.html
More file actions
55 lines (53 loc) · 2.4 KB
/
update.html
File metadata and controls
55 lines (53 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<title>Dataset Project</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://caltechlibrary.github.io/css/site.css">
</head>
<body>
<header>
<a href="http://library.caltech.edu" title="link to Caltech Library Homepage"><img src="https://caltechlibrary.github.io/assets/liblogo.gif" alt="Caltech Library logo"></a>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="../">README</a></li>
<li><a href="../LICENSE">LICENSE</a></li>
<li><a href="../INSTALL.html">INSTALL</a></li>
<li><a href="../user_manual.html">User Manual</a></li>
<li><a href="../about.html">About</a></li>
<li><a href="../search.html">Search</a></li>
<li><a href="https://github.com/caltechlibrary/dataset">GitHub</a></li>
</ul>
</nav>
<section>
<h1 id="update">update</h1>
<h2 id="syntax">Syntax</h2>
<pre class="shell"><code> dataset update COLLECTION_NAME KEY</code></pre>
<h2 id="description">Description</h2>
<p><em>update</em> will replace a JSON document in a dataset collection
for a given KEY. By default the JSON document is read from standard
input but you can specific a specific file with the “-input” option. The
JSON document should already exist in the collection when you use
update.</p>
<h2 id="usage">Usage</h2>
<p>In this example we assume there is a JSON document on local disc
named <em>jane-doe.json</em>. It contains
<code>{"name":"Jane Doe"}</code> and the KEY is “jane.doe”. In the first
one we specify the full JSON document via the command line after the
KEY. In the second example we read the data from <em>jane-doe.json</em>.
Finally in the last we read the JSON document from standard input and
save the update to “jane.doe”. The collection name is “people.ds”.</p>
<pre class="shell"><code> dataset update people.ds jane.doe '{"name":"Jane Doiel"}'
dataset update -i jane-doe.json people.ds jane.doe
cat jane-doe.json | dataset update people.ds jane.doe</code></pre>
</section>
<footer>
<span>© 2022 <a href="https://www.library.caltech.edu/copyright">Caltech Library</a></span>
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
<span><a href="mailto:library@caltech.edu">Email Us</a></span>
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
</footer>
</body>
</html>